# Kotlin Native

适用于 macOS 的 Kotlin/Native 工具链包，包含 LLVM 后端以及用于原生编译和相关任务的命令行工具。

> 这是 OpenNavo 上 Kotlin Native 页面的 Markdown 版本，内容与网页相同： <https://opennavo.com/zh/apps/kotlin-native>

- **最新版本**: `2.4.21`
- **开发者**: JetBrains s.r.o. and Kotlin Programming Language contributors
- **主页**: <https://kotlinlang.org/docs/reference/native-overview.html>
- **分类**: [编程语言与运行时](https://opennavo.com/zh/categories/languages)
- **安装**: `brew install --cask kotlin-native`
- **近 30 天安装**: 13
- **Homebrew**: 可以安装，由 Homebrew 更新
- **下载地址**: <https://github.com/JetBrains/kotlin/releases/download/v2.4.21/kotlin-native-prebuilt-macos-aarch64-2.4.21.tar.gz>
- **SHA-256**: `bf4edb526d91e17d0862102f69250525d788e79011f86c2c64362749adf260ae`
- **附带命令**: cinterop, generate-platform, klib, konan-lldb, konanc, kotlinc-native, run_konan

SHA-256 只用来核对下载的文件是否完整，不代表安全认证。

## 注意事项

kotlin-native requires Java 6+. You can install the latest version with: brew install --cask temurin

## 安装与卸载内容

```json
[
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/cinterop"
      ],
      "target": "$HOMEBREW_PREFIX/bin/cinterop"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/cinterop"
    ],
    "target": "$HOMEBREW_PREFIX/bin/cinterop",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/generate-platform"
      ],
      "target": "$HOMEBREW_PREFIX/bin/generate-platform"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/generate-platform"
    ],
    "target": "$HOMEBREW_PREFIX/bin/generate-platform",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/klib"
      ],
      "target": "$HOMEBREW_PREFIX/bin/klib"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/klib"
    ],
    "target": "$HOMEBREW_PREFIX/bin/klib",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/konan-lldb"
      ],
      "target": "$HOMEBREW_PREFIX/bin/konan-lldb"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/konan-lldb"
    ],
    "target": "$HOMEBREW_PREFIX/bin/konan-lldb",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/konanc"
      ],
      "target": "$HOMEBREW_PREFIX/bin/konanc"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/konanc"
    ],
    "target": "$HOMEBREW_PREFIX/bin/konanc",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/kotlinc-native"
      ],
      "target": "$HOMEBREW_PREFIX/bin/kotlinc-native"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/kotlinc-native"
    ],
    "target": "$HOMEBREW_PREFIX/bin/kotlinc-native",
    "type": "binary"
  },
  {
    "declaration": {
      "binary": [
        "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/run_konan"
      ],
      "target": "$HOMEBREW_PREFIX/bin/run_konan"
    },
    "phase": "install",
    "sources": [
      "kotlin-native-prebuilt-macos-aarch64-2.4.21/bin/run_konan"
    ],
    "target": "$HOMEBREW_PREFIX/bin/run_konan",
    "type": "binary"
  },
  {
    "declaration": {
      "zap": []
    },
    "phase": "cleanup",
    "sources": [],
    "type": "zap"
  }
]
```

## 介绍

Kotlin Native 是适用于 macOS 的 Kotlin/Native 工具链包，其定位是 Kotlin 的 LLVM 后端。它提供命令行工具，而非图形应用。安装的二进制文件包括用于 Kotlin/Native 编译流程的 `konanc` 和 `kotlinc-native`，以及用于相关任务的 `cinterop`、`klib`、`generate-platform`、`konan-lldb` 和 `run_konan`。此软件包包含这些工具；现有产品信息未详细说明各工具的选项或完整开发流程。

使用 Homebrew Cask 安装：

```sh
brew install --cask kotlin-native
```

需要 Java 6 或更高版本。如果尚未安装 Java，Cask 建议使用 `brew install --cask temurin` 安装 Temurin。Cask 提供适用于 Apple 芯片（`aarch64`）和 Intel（`x86_64`）系统的 macOS 下载包。安装后，可根据 Kotlin/Native 工作需要，在终端中使用相应命令行工具。此软件包是原生工具链，不是 Kotlin IDE 或图形应用。

来源：[Kotlin Native 概览](https://kotlinlang.org/docs/reference/native-overview.html) · [Homebrew Cask](https://raw.githubusercontent.com/Homebrew/homebrew-cask/HEAD/Casks/k/kotlin-native.rb)

## 系统要求

- 适用于 macOS 27, 26, 15, 14, 13, 12, 11 的版本 · 应用版本: 2.4.21 · Intel · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/k/kotlin-native.rb> · 核查于 2026-11-29
  - <https://github.com/JetBrains/kotlin/releases/download/v2.4.21/kotlin-native-prebuilt-macos-x86_64-2.4.21.tar.gz>
  - SHA-256: `741799f163ad240f7fe54fae5334490c5a8a8fca9b9e9d39495db497b4f1763c`
- 适用于 macOS 27, 26, 15, 14, 13, 12, 11 的版本 · 应用版本: 2.4.21 · Apple 芯片 · <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/k/kotlin-native.rb> · 核查于 2026-11-29
  - <https://github.com/JetBrains/kotlin/releases/download/v2.4.21/kotlin-native-prebuilt-macos-aarch64-2.4.21.tar.gz>
  - SHA-256: `bf4edb526d91e17d0862102f69250525d788e79011f86c2c64362749adf260ae`

## 卸载

- `brew uninstall --cask kotlin-native`

普通卸载会删除应用本身，设置和缓存会保留。

## 最新版本说明

### 2.5.0-rc2 (2026-11-25)

#### Changelog

##### Backend. Wasm

- [`KT-91749`](https://youtrack.jetbrains.com/issue/KT-91749) Kotlin/Wasm: cos is ~47% slower in 2.5.0-RC than in 2.4.21

##### Compiler

- [`KT-91549`](https://youtrack.jetbrains.com/issue/KT-91549) Slowdown in compose benchmarks in Float.fromBits

##### Tools. Compiler Plugins

- [`KT-91488`](https://youtrack.jetbrains.com/issue/KT-91488) Lombok: Kotlin use of one sibling `@SuperBuilder` leaf's builder() makes the other leaf's inherited parent-builder setters unresolved
- [`KT-87563`](https://youtrack.jetbrains.com/issue/KT-87563) Lombok: StackOverflow with `@SuperBuilder` and cyclic inheritance hierarchy

##### Tools. Compiler plugins. Compose

- [`KT-91414`](https://youtrack.jetbrains.com/issue/KT-91414) Compose compiler, Kotlin/Native: lambda SAM-converted to `@Composable` fun interface gets no restart group; recomposition fails with "No nodes can be emitted before calling skipAndEndGroup"
- [`KT-91591`](https://youtrack.jetbrains.com/issue/KT-91591) Compose: NoSuchFieldError when a cross-module `@JvmField` property of `@Composable` lambda type is accessed more than once (field arity grows by 2 per access)

##### Tools. Gradle. JS

- [`KT-90626`](https://youtrack.jetbrains.com/issue/KT-90626) Analysis API-based TypeScript declarations ignore the JS file name set on the link task
- [`KT-90770`](https://youtrack.jetbrains.com/issue/KT-90770) Analysis API-based TypeScript declarations ignore the module name set on the link task for UMD and plain modules

## 资料与来源

- <https://opennavo.com/zh/apps/kotlin-native>
- <https://opennavo.com/zh/apps/kotlin-native/versions>
- <https://github.com/homebrew/homebrew-cask/blob/HEAD/Casks/k/kotlin-native.rb> · 核查于 2026-11-29
- <https://formulae.brew.sh/cask/kotlin-native>
