Kotlin/Native target support
The Kotlin/Native compiler supports a great number of different targets, though it is hard to provide the same level of support for all of them. This document describes which targets Kotlin/Native supports and breaks them into several tiers depending on how well the compiler supports them.
tip
We can adjust the number of tiers, the list of supported targets, and their features as we go.
Mind the following terms used in tier tables:
Gradle target name is a target name that is used in the Kotlin Multiplatform Gradle plugin to enable the target.
Target triple is a target name according to the
<architecture>-<vendor>-<system>-<abi>
structure that is commonly used by compilers.Running tests indicates out of the box support for running tests in Gradle and IDE.
This is only available on a native host for the specific target. For example, you can run
macosX64
andiosX64
tests only on macOS x86-64 host.
The target is regularly tested on CI to be able to compile and run.
We provide a source and binary compatibility between compiler releases.
Gradle target name | Target triple | Running tests | Description |
---|---|---|---|
Apple macOS hosts only: | |||
|
| ✅ | Apple macOS on x86_64 platforms |
|
| ✅ | Apple macOS on Apple Silicon platforms |
|
| ✅ | Apple iOS simulator on Apple Silicon platforms |
|
| ✅ | Apple iOS simulator on x86-64 platforms |
|
| Apple iOS and iPadOS on ARM64 platforms |
The target is regularly tested on CI to be able to compile, but may not be automatically tested to be able to run.
We're doing our best to provide a source and binary compatibility between compiler releases.
Gradle target name | Target triple | Running tests | Description |
---|---|---|---|
|
| ✅ | Linux on x86_64 platforms |
|
| Linux on ARM64 platforms | |
Apple macOS hosts only: | |||
|
| ✅ | Apple watchOS simulator on Apple Silicon platforms |
|
| ✅ | Apple watchOS 64-bit simulator on x86_64 platforms |
|
| Apple watchOS on ARM32 platforms | |
|
| Apple watchOS on ARM64 platforms with ILP32 | |
|
| ✅ | Apple tvOS simulator on Apple Silicon platforms |
|
| ✅ | Apple tvOS simulator on x86_64 platforms |
|
| Apple tvOS on ARM64 platforms |
The target is not guaranteed to be tested on CI.
We can't promise a source and binary compatibility between different compiler releases, though such changes for these targets are quite rare.
Gradle target name | Target triple | Running tests | Description |
---|---|---|---|
|
| Android NDK on ARM32 platforms | |
|
| Android NDK on ARM64 platforms | |
|
| Android NDK on x86 platforms | |
|
| Android NDK on x86_64 platforms | |
|
| ✅ | 64-bit Windows 7 and later using MinGW compatibility layer |
Apple macOS hosts only: | |||
|
| Apple watchOS on ARM64 platforms |
note
The
linuxArm32Hfp
target is deprecated and will be removed in future releases.
We don't recommend library authors to test more targets or provide stricter guarantees than the Kotlin/Native compiler does. You can use the following approach when considering support for native targets:
Support all the targets from tier 1, 2, and 3.
Regularly test targets from tier 1 and 2 that support running tests out of the box.
The Kotlin team uses this approach in the official Kotlin libraries, for example, kotlinx.coroutines and kotlinx.serialization.
Thanks for your feedback!