Kotlin Multiplatform
JetBrains Fleet supports development of Kotlin Multiplatform Projects, featuring cross-language code intelligence features, navigation, debugging, refactoring, and more. For iOS development, it provides full Swift support to assist you in working with native app components.
Prerequisites
A macOS computer with JetBrains Fleet installed.
JDK 17
Android Studio if you want to target Android.
Xcode if you want to target iOS.
To run and debug Android applications, you will additionally need to create a Virtual Device within Android Studio.
If you experience problems running an iOS project, on either Simulator or Device, please verify that you can run the embedded project (in the iosApp folder) from Xcode, then restart JetBrains Fleet.
Create a multiplatform project
To create a new multiplatform project, use the online new project wizard.
Open https://kmp.jetbrains.com in your browser.
Indicate the platforms that you want to target
Press the Download button, then unpack the ZIP.
Running the project
After you turn the Smart Mode on, JetBrains Fleet will automatically detect run configurations for the appropriate targets.
You can run them through the Run & Debug dialog.
Run your project on a specific device
When opening a project, JetBrains Fleet creates run configurations for the targets found in the build file. To access run configurations, you can:
Use the ⌘ R shortcut.
Select
in the main menu.Click the icon at the top of the window.
From the Run destination drop-down list, select the necessary device. For more information about the device chooser, refer to Selecting a device to execute the configuration.
For example, if you select the iosApp
configuration from the list and run it. The application will automatically be executed on the iPhone simulator.
The build window displays how the application was compiled and launched.
Selecting a device to execute the configuration
You can select a device that the configuration should use to run your code. The device chooser is available in the following controls:
in the Run & Debug list. To open the Run & Debug list, press ⌘ R or click Run .
in the Run & Debug list, click the ellipsis icon.
in test files in the gutter near the corresponding code.
Using Logcat for Android applications
Logcat is a command-line utility that captures a log of system messages, including those generated by your application using the Log
class.
Viewing the Logcat log
To view the Logcat log while your Android application runs:
Click on the Click here to open your Logcat link at the end of the build log in the application running tab.
Filtering the log
You can filter your Logcat log by using the following options:
The Minimum Log Level drop-down list: in the Logcat tab, select the desired minimum error logging level from the Minimum Log Level drop-down list.
The Filter log search field: in the Logcat tab, click the Filter log search field and type your search request to filter log results.
Kotlin Multiplatform Documentation
For more information on developing Kotlin multiplatform applications, refer to Kotlin Multiplatform documentation.