Cross-compilation Swift SDKs for Android

An Android SDK bundle for Swift 6 has been up for the last month. The new bundle simplifies cross-compiling Swift packages to Android and now supports cross-compiling from a macOS host too, which has been tested on my daily Android CI for the last couple months, thanks to @marcprux who added that macOS support (check out his Skip toolchain, which is starting to provide Android cross-compilation from macOS in beta).

Native builds of the Swift 6 toolchain that run directly on Android and ChromeOS devices are now available in the Termux app.

Both the new Swift 6 SDK bundle and toolchain use Alex's work on the new Android overlay and the Foundation rewrite for the first time. There is currently a Swift 6 regression where some Foundation and stdlib code cannot be used on Android APIs 24-28: I will update the SDK bundle and native toolchain once I find a fix for that.

After that, the next step is getting Android into the official Swift CI. Thanks to everyone who contributed to getting Swift on Android this far.

9 Likes