-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
The easiest way to install the Swift Toolchain for Android is by installing scd
, the SCADE Build Tool, via the Homebrew package manager. The scd
tool will install all the necessary components for building Swift code for Android. To install scd
via Brew, run the following command:
brew install scade-platform/toolchain/scd
You can create a new SPM project with the swift package
command:
mkdir AndroidHelloWorld
cd AndroidHelloWorld
swift package init
To build newly created SPM project for Android platform, execute the scd build
command:
scd build --platform android-arm64-v8a
This command will build the project for the ARM64 architecture for Android.
The scd
build tool can build an SPM project for multiple Android architectures and archive it into a single directory suitable for embedding into Android projects. To create an archive, run the scd archive
command with the set of Android platforms you want to build:
scd archive --platform android-arm64-v8a \
--platform android-x86_64 \
--platform android-armeabi-v7a \
--platform android-x86
The resulting archive directory will be placed into the lib
subdirectory of the current working directory. You can change the output directory using the -o argument.