|
|
vor 3 Jahren | |
|---|---|---|
| .run | vor 3 Jahren | |
| androidApp | vor 3 Jahren | |
| desktopApp | vor 3 Jahren | |
| gradle | vor 3 Jahren | |
| iosApp | vor 3 Jahren | |
| shared | vor 3 Jahren | |
| .gitignore | vor 3 Jahren | |
| LICENSE.txt | vor 3 Jahren | |
| README.md | vor 3 Jahren | |
| build.gradle.kts | vor 3 Jahren | |
| cleanup.sh | vor 3 Jahren | |
| gradle.properties | vor 3 Jahren | |
| gradlew | vor 3 Jahren | |
| gradlew.bat | vor 3 Jahren | |
| settings.gradle.kts | vor 3 Jahren |
Use this template to start developing your own Compose Multiplatform application targeting desktop, Android, and iOS (experimental).
This template contains desktopApp run configuration that you can use to run the desktop target in Android Studio or IntelliJ IDEA.
Useful Gradle tasks:
./gradlew run - run application./gradlew package - package native distribution into build/compose/binariesTo run on Android, use the androidApp run configuration in Android Studio
or use Gradle:
./gradlew installDebug - install Android application on an Android device (on a real device or on an emulator)
Make sure you have set up your environment for mobile development with Kotlin Multiplatform. A detailed guide on how to set up your environment is available in the Kotlin Multiplatform documentation.
To work with the iOS target you need:
Before opening the project in Android Studio, make sure that your environment is set up for iOS and Kotlin Multiplatform development.
Use kdoctor to ensure your development environment is configured correctly.
We suggest going through the "Hello, World" steps of creating and deploying a sample project in Xcode to a simulator and/or your physical device. A video tutorial for setting up Xcode and running your first "Hello, World" application is available in this Standford CS193P lecture recording.
Once you have configured your environment correctly, you will be able to select which iOS simulator to run your application in Android Studio on by modifying the iosApp run configuration.
Select "Run" | "Edit Configurations..." and navigate to the "iOS Application" | "iosApp" run configuration. In the "Execution target" drop-down, select your target device.
Running your Compose Multiplatform application on a physical device can be done for free. You need:
If you use a free Personal Team for signing applications to run on a real device, you'll have to find your team ID.
The easiest way is to refer to your "Hello, World" project that you created while setting up your development environment. Use your terminal to navigate to the folder where you have created the Xcode project (.xcodeproj) and run the following command:
grep -r "DEVELOPMENT_TEAM"
In your multiplatform project, navigate to iosApp/Configuration/Config.xcconfig and set the TEAM_ID to the value you've gotten from the previous command.
After that you can open the project in Android Studio, and it will show the registered iOS device in the iosApp
run configuration.
iosApp/Configuration/Config.xcconfig in the TEAM_ID fieldAfter that you can open the project in Android Studio, and it will show the registered iOS device in the iosApp
run configuration.
This template contains a iosApp/Configuration/Config.xcconfig configuration file that allows you to configure most basic properties without having to move to Xcode. It contains:
APP_NAME - target executable and application bundle nameBUNDLE_ID - bundle identifierTEAM_ID - Team IDNote: To configure the APP_NAME setting, open Config.xcconfig in any text editor before opening the project in Android Studio, and set the desired name.
If you need to change this setting after you open the project in Android Studio, please do the following:
./cleanup.sh in your terminalFor configuring advanced settings, you can use Xcode. Open the iosApp/iosApp.xcworkspace in Xcode after opening the project in Android Studio, and use Xcode to make your changes.