0Pricing
Kotlin Multiplatform Academy · Lekcja

Cele: Android, iOS, Desktop, Web, Server

Platformy, na które można kompilować jeden kod Kotlin

Cele: Android, iOS, Desktop, Web, Server to bezpłatna lekcja Kotlin Multiplatform Academy na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Kotlin Multiplatform Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Kotlin Multiplatform Academy zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

What Is a Target

A target is a platform your Kotlin code compiles to. One shared codebase can produce builds for several targets at once. 🎯

The Android Target

Android is the most common starting target. Kotlin compiles to JVM bytecode, the same format Android apps have always used.

The iOS Target

For iOS, Kotlin compiles ahead of time into a native binary using Kotlin/Native, packaged as a framework Swift can call.

The Desktop Target

Desktop apps for Windows, macOS, and Linux run on the JVM too. The same desktop target serves all three operating systems.

The Web Target

Kotlin can target the browser by compiling to JavaScript or to WebAssembly, so shared logic runs on the web as well.

The Server Target

On the backend, Kotlin runs on the JVM server side. You can even share models and validation between your app and your API.

Declaring Targets

You list targets in your Gradle build. Each call like androidTarget adds one platform to the shared module.

kotlin {
    androidTarget()
    iosArm64()
    jvm("desktop")
}

Pick Only What You Need

You do not have to ship every target. Most teams start with just Android and iOS and add more targets only when needed.

iOS Has Variants

iOS itself has a few targets: real devices use arm64, while the simulator uses x64 or arm64 depending on your Mac.

Share the Same Source

Every target reads from your common code. That shared source set is compiled fresh for each platform you declared.

One Codebase, Many Outputs

The magic is reach: a single Kotlin codebase becomes an APK, an iOS framework, a desktop app, and more from one build.

Quick Check

Let's confirm what targets are.

Recap

Targets are the platforms you compile to: Android, iOS, desktop, web, and server. Declare only the targets your team actually needs. 🌍

Często zadawane pytania

Czy lekcja „Cele: Android, iOS, Desktop, Web, Server” jest bezpłatna?

Tak — pełny tekst „Cele: Android, iOS, Desktop, Web, Server” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Kotlin Multiplatform Academy, przejdź na CoddyKit PRO. Kurs Kotlin Multiplatform Academy zawiera 4 lekcji w sumie.

Co nauczysz się w „Cele: Android, iOS, Desktop, Web, Server”?

Platformy, na które można kompilować jeden kod Kotlin Ćwiczysz Kotlin Multiplatform Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Kotlin Multiplatform Academy?

Nie wymagamy żadnego doświadczenia. Kotlin Multiplatform Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.

Ile czasu zajmuje lekcja „Cele: Android, iOS, Desktop, Web, Server”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Kotlin Multiplatform Academy?

Tak. Każda lekcja Kotlin Multiplatform Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Współdzielenie logiki, nie interfejsu: obietnica KMP
  2. KMP a Flutter i React Native
  3. Cele: Android, iOS, Desktop, Web, Server
  4. Co można, a czego nie można jeszcze współdzielić
← Powrót do Kotlin Multiplatform Academy