Skip to content

Releases: swift-android-sdk/swift-android-sdk

DEVELOPMENT-SNAPSHOT-2025-11-03-a

08 Nov 17:15
21665e0

Choose a tag to compare

Pre-release

To get official trunk snapshots of the Swift SDK for Android from now on, please go to swift.org. This is a testing snapshot against the new stable NDK 28, so that the new #available(Android <API>, *) feature can be tried out.

Installing the Swift Android SDK

First install the matching Swift main-snapshot-2025-11-03-a toolchain from https://www.swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install main-snapshot-2025-11-03-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/DEVELOPMENT-SNAPSHOT-2025-11-03-a/swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a_android.artifactbundle.tar.gz --checksum d3525b67d6e4e9b1cdcb1dde18e5589680967ea646966050621ea4864f1efe91

Note

You can also try the swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a_android-27.artifactbundle.tar.gz provided with NDK 28c, even though that SDK bundle itself is built by LTS NDK 27d. In limited testing, both bundles could be used with NDK 28c, but please try them for yourself and let us know if you see any incompatibilities.

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r28c stable release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r28c-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r28c ~/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r28c-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r28c ~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME ~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the latest Android NDKs but defines ANDROID_NDK_LATEST_HOME for NDK 28c right now, so use that instead.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-11-03-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable that uses the new feature with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable

Next, edit the generated source file Sources/ExecutableDemo/ExecutableDemo.swift to use the new #available(Android check instead:

#if canImport(Android)
import Android
import Dispatch
#endif

@available(Android 33, *)
func backtrace() {
    withUnsafeTemporaryAllocation(of: UnsafeMutableRawPointer.self, capacity: 1) { address in
        _ = backtrace(address.baseAddress!, 1)
    }
}

@available(Android 35, *)
func hello35() {
    print("Hello from API newer than 33")
}

@available(Android 27, *)
func hello27() {
    print("Hello, world!")
}

@main
struct ExecutableDemo {

    static func main() {
        #if os(Android)
          hello27()
          if #available(Android 33, *) {
            backtrace()
            print("Hello from Android API 33+")
            if #available(Android 35, *) {
              hello35()
            }
          }
        #endif
    }
}

Try modifying and removing various parts of that version checking to see if it compiles. Finally, cross-compile and run the above file:

$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-11-03-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

On an Android device or emulator running at API level 32 or before, you will see:

Hello, world!

On a device at API level 35 or newer, you should see this instead:

Hello, world!
Hello from Android API 33+
Hello from API newer than 33

6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a

29 Oct 19:06
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift 6.2-snapshot-2025-10-25-a toolchain from https://swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install 6.2-snapshot-2025-10-25-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a-android-0.1.artifactbundle.tar.gz --checksum bfbbabf5eb1b997b65513ff9e0d89054a8ec664483254844efc7a8855f16dacb

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-25-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-25-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-25-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a

12 Oct 15:35
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift 6.2-snapshot-2025-10-09-a toolchain from https://swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install 6.2-snapshot-2025-10-09-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a-android-0.1.artifactbundle.tar.gz --checksum 629fcab9b38cc8d851db5926785a66e3c9eba0a52903ab7adb4cdf6da6efab69

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-09-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-09-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-09-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a

11 Oct 18:14
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift 6.2-snapshot-2025-10-08-a toolchain from https://swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install 6.2-snapshot-2025-10-08-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a-android-0.1.artifactbundle.tar.gz --checksum 70377f8eccab712af30ac682b96e15018db343fe80b62420111573eb7a8c34a3

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-08-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-08-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-08-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a

06 Oct 18:58
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift 6.2-snapshot-2025-10-01-a toolchain from https://swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install 6.2-snapshot-2025-10-01-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a-android-0.1.artifactbundle.tar.gz --checksum 9446c20657ab94b36f617d0b05079705fdb50a28bbc0b6c0c96d0b25800c3e1e

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-10-01-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-01-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-10-01-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a

04 Oct 17:31
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift 6.2-snapshot-2025-09-29-a toolchain from https://swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install 6.2-snapshot-2025-09-29-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle.tar.gz --checksum 8f3d2beafec80471d41095b6a71a8b274a24c513ed9d4f8ff21300fa6a3aa5c7

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-09-29-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2-snapshot-2025-09-29-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

DEVELOPMENT-SNAPSHOT-2025-10-16-a

29 Oct 15:19
4bbceb9

Choose a tag to compare

Pre-release

Warning

This is an experimental build of the Swift SDK for Android that supports back to Android API 23, as discussed at https://forums.swift.org/t/android-api-minimum-for-the-swift-sdk-for-android/82874/9

Installing the Swift SDK for Android

First install the matching Swift main-snapshot-2025-10-16-a toolchain from https://swift.org/download/#releases and add it to your PATH, or by using swiftly:

swiftly install main-snapshot-2025-10-16-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/DEVELOPMENT-SNAPSHOT-2025-10-16-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android.artifactbundle.tar.gz --checksum bf1ab194b80a83c75f10dbd74b031f001b73bf18fd147ea0a11c854fee7124fc

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27c LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27c-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27c ~/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27c-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27c ~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternatively, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android23 +main-snapshot-2025-10-16-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-10-16-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb push ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/*/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

DEVELOPMENT-SNAPSHOT-2025-10-02-a

08 Oct 22:47
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift main-snapshot-2025-10-02-a toolchain from https://www.swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install main-snapshot-2025-10-02-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/DEVELOPMENT-SNAPSHOT-2025-10-02-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-android-0.1.artifactbundle.tar.gz --checksum 46f01534412f4998f996a6231ad695ed67760cac59f82f86b48a2eae7eb8fd66

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-10-02-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-10-02-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

DEVELOPMENT-SNAPSHOT-2025-09-29-a

01 Oct 19:21
4bbceb9

Choose a tag to compare

Pre-release

Installing the Swift Android SDK

First install the matching Swift main-snapshot-2025-09-29-a toolchain from https://www.swift.org/install/ and add it to your PATH, or by using swiftly:

swiftly install main-snapshot-2025-09-29-a

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/DEVELOPMENT-SNAPSHOT-2025-09-29-a/swift-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle.tar.gz --checksum 0e2b5ddfc80e51c038a0787ea3cf877fa360f67dcf88661de18cf34281920657

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-09-29-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternately, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-09-29-a

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +main-snapshot-2025-09-29-a
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo

6.2

18 Sep 01:19
17d709f

Choose a tag to compare

Installing the Swift Android SDK

First install the matching Swift 6.2 toolchain from https://swift.org/download/#releases and add it to your PATH, or by using swiftly:

swiftly install 6.2

Then install the Swift Android SDK by running the command:

swift sdk install https://github.com/swift-android-sdk/swift-android-sdk/releases/download/6.2/swift-6.2-RELEASE-android-0.1.artifactbundle.tar.gz --checksum ca7e09f09a591b6a661a39134aaf53b1b59d5e3a193b271ab1f20effdfc6e88e

Installing the Android NDK

The Swift Android SDK requires the Android Native Development Toolkit (NDK) to function, which must be installed separately. Download and unzip the r27d LTS release and set the ANDROID_NDK_HOME environment variable to the local NDK installation and run the setup script.

macOS configuration command for android-ndk-r27d-darwin.zip:

ANDROID_NDK_HOME=~/Downloads/android-ndk-r27d ~/Library/org.swift.swiftpm/swift-sdks/swift-6.2-RELEASE-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Linux configuration command for android-ndk-r27d-linux.zip:

ANDROID_NDK_HOME=~/android-ndk-r27d ~/.swiftpm/swift-sdks/swift-6.2-RELEASE-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

GitHub Actions:

~/.swiftpm/swift-sdks/swift-6.2-RELEASE-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh

Note

GitHub Actions already includes the Android NDK and defines ANDROID_NDK_HOME, so there is no need to install the NDK separately. Alternatively, you can use the swift-android-action to build Swift packages and run Android tests from a GitHub workflow.

Building Swift Packages for Android

Now you can compile a Swift package for Android with:

$ git clone https://github.com/apple/swift-algorithms.git
$ cd swift-algorithms/
$ swiftly run swift build --swift-sdk aarch64-unknown-linux-android28 +6.2

Running Swift Executables on Android

If you have a connected Android device with USB debugging enabled, or are running an Android emulator, you can create and run a Swift executable with the following commands:

$ mkdir ExecutableDemo
$ cd ExecutableDemo
$ swift package init --type executable
$ swiftly run swift build --static-swift-stdlib --swift-sdk aarch64-unknown-linux-android28 +6.2
$ adb push .build/debug/ExecutableDemo /data/local/tmp/
$ adb push ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/*/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp/
$ adb shell /data/local/tmp/ExecutableDemo