ターゲット:Android、iOS、Desktop、Web、Server
1つのKotlinコードベースをコンパイルできるプラットフォームを学びます
「ターゲット:Android、iOS、Desktop、Web、Server」はCoddyKit上の無料Kotlin Multiplatform Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはKotlin Multiplatform Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
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. 🌍
よくある質問
「ターゲット:Android、iOS、Desktop、Web、Server」レッスンは無料ですか?
はい。「ターゲット:Android、iOS、Desktop、Web、Server」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Kotlin Multiplatform Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
「ターゲット:Android、iOS、Desktop、Web、Server」で何を学びますか?
1つのKotlinコードベースをコンパイルできるプラットフォームを学びます ブラウザで直接実行するハンズオンコードでKotlin Multiplatform Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Kotlin Multiplatform Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのKotlin Multiplatform Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。
「ターゲット:Android、iOS、Desktop、Web、Server」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このKotlin Multiplatform Academyレッスンでコードを書いて実行できますか?
はい。すべてのKotlin Multiplatform Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- ロジックを共有し、UIは共有しない:KMPの約束
- KMP、Flutter、React Nativeの比較
- ターゲット:Android、iOS、Desktop、Web、Server
- 現時点で共有できるもの、できないもの