Kotlin/Native target support | Kotlin (original) (raw)

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.

Mind the following terms used in tier tables:

Tier 1

Gradle target name Target triple Running tests Description
Apple macOS hosts only:
macosX64 x86_64-apple-macos Apple macOS on x86_64 platforms
macosArm64 aarch64-apple-macos Apple macOS on Apple Silicon platforms
iosSimulatorArm64 aarch64-apple-ios-simulator Apple iOS simulator on Apple Silicon platforms
iosX64 x86_64-apple-ios-simulator Apple iOS simulator on x86-64 platforms
iosArm64 aarch64-apple-ios Apple iOS and iPadOS on ARM64 platforms

Tier 2

Gradle target name Target triple Running tests Description
linuxX64 x86_64-unknown-linux-gnu Linux on x86_64 platforms
linuxArm64 aarch64-unknown-linux-gnu Linux on ARM64 platforms
Apple macOS hosts only:
watchosSimulatorArm64 aarch64-apple-watchos-simulator Apple watchOS simulator on Apple Silicon platforms
watchosX64 x86_64-apple-watchos-simulator Apple watchOS 64-bit simulator on x86_64 platforms
watchosArm32 armv7k-apple-watchos Apple watchOS on ARM32 platforms
watchosArm64 arm64_32-apple-watchos Apple watchOS on ARM64 platforms with ILP32
tvosSimulatorArm64 aarch64-apple-tvos-simulator Apple tvOS simulator on Apple Silicon platforms
tvosX64 x86_64-apple-tvos-simulator Apple tvOS simulator on x86_64 platforms
tvosArm64 aarch64-apple-tvos Apple tvOS on ARM64 platforms

Tier 3

Gradle target name Target triple Running tests Description
androidNativeArm32 arm-unknown-linux-androideabi Android NDK on ARM32 platforms
androidNativeArm64 aarch64-unknown-linux-android Android NDK on ARM64 platforms
androidNativeX86 i686-unknown-linux-android Android NDK on x86 platforms
androidNativeX64 x86_64-unknown-linux-android Android NDK on x86_64 platforms
mingwX64 x86_64-pc-windows-gnu 64-bit Windows 7 and later using MinGW compatibility layer
Apple macOS hosts only:
watchosDeviceArm64 aarch64-apple-watchos Apple watchOS on ARM64 platforms

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:

The Kotlin team uses this approach in the official Kotlin libraries, for example, kotlinx.coroutines and kotlinx.serialization.

Last modified: 27 November 2024