Set up an environment for KMM development
Before you begin creating your first application to work on both iOS and Android, start by setting up an environment for Kotlin Multiplatform Mobile (KMM) development:
If you are going to work with shared code or Android-specific code, you can work on any computer with an operating system supported by Android Studio.
If you also want to write iOS-specific code and run an iOS application on a simulated or real device, use a Mac with a macOS.
Install Android Studio – version 4.1 or higher.
You will use Android Studio for creating your multiplatform applications and running them on simulated or hardware devices.
If you need to write iOS-specific code and run an iOS application, install Xcode – version 11.3 or higher.
Most of the time, Xcode will work in the background. You will use it to add Swift or Objective-C code to your iOS application.
Update the Kotlin plugin to version 1.4.20 or higher.
In Android Studio, select Tools | Kotlin | Configure Kotlin Plugin Updates and update to the latest version in the Stable update channel.
Install the Kotlin Multiplatform Mobile plugin.
In Android Studio, select Preferences | Plugins, search for the plugin Kotlin Multiplatform Mobile in Marketplace and install it.
Check out KMM plugin release notes.
Install the JDK if you haven't already done so.
To check if it's installed, run the command
java -versionin the Terminal.
Now it's time to create your first KMM application.