This is a swift cross-compilation toolchain for Android. It publishes release and development builds from the swift-android-sdk project.
The latest version can be installed and updated on macOS with the Homebrew command:
$ brew install skiptools/skip/swift-android-toolchain@6.0
or by using the Skip command:
$ brew install skiptools/skip/skip
$ skip android sdk install
$ skip checkup --native
Both these commands will install the corresponding Swift OSS toolchain, which is required to match the version of the Android SDK:
$ ls ~/Library/Developer/Toolchains/ ~/Library/org.swift.swiftpm/swift-sdks/
~/Library/Developer/Toolchains/:
swift-6.0.3-RELEASE.xctoolchain
~/Library/org.swift.swiftpm/swift-sdks/:
swift-6.0.3-RELEASE-android-24-0.1.artifactbundle
To install on Linux, first download and install the corresponding Swift version from swift.org.
Then install the toolchain with the swift sdk install
command corresponding to the toolchain
release.
You can list the installed versions of the SDK with:
$ swift sdk list
swift-6.0.3-RELEASE-android-24-0.1
Any particular version can be removed with:
$ swift sdk remove swift-6.0.3-RELEASE-android-24-0.1
It can also be used from a GitHub workflow with the swift-android-action to build and test Swift packages on Android from macOS or Linux runners:
- uses: actions/checkout@v4
- name: "Test Swift Package"
run: swift test
- name: "Test Swift Package on Android"
uses: skiptools/swift-android-action@v2