Building SPM Projects
scd supports building SPM projects for multiple platforms out of the box, including Android. The build command compiles an SPM project for a target platform. It’s the command you use during everyday development to check for compile errors and warnings, without producing a distributable artifact — for that, see archive.
archive and test also compile your project using this same build logic before packaging or deploying it, so everything on this page applies to them as well.
For each platform, scd resolves the correct SDK and toolchain paths and automatically passes the compiler and linker options required to produce a working binary for that platform — so you don’t have to figure out and maintain those flags yourself.
scd build --platform <platform> --configuration ReleaseSee SPM Build Options for the full list of build flags, and Platforms for supported --platform values.
Android
Section titled “Android”This is where scd build matters most. It uses the SCADE Android Swift SDK and automatically applies several Android-specific compatibility flags — see Platforms for details.
For example, to build for Android ARM64 in Release mode:
scd build --platform android-arm64-v8a --configuration Releasebuild targets a single platform per invocation. To produce artifacts for multiple Android ABIs at once, use archive instead.
To build a specific target instead of the whole project:
scd build --platform android-arm64-v8a --target MyLibraryTo build using a custom Android SDK and NDK location:
scd build --platform android-arm64-v8a --android-sdk ~/Library/Android/sdk --android-ndk ~/Library/Android/sdk/ndk/27.0.12077973Host Platform (macOS)
Section titled “Host Platform (macOS)”For the host platform, build resolves the Xcode and Swift toolchain to use (see Global Options) and otherwise behaves like a direct wrapper around swift build.
For example, to build for macOS, the default platform on a macOS host:
scd buildTo build using a specific Xcode installation:
scd build --xcode /Applications/Xcode-16.appTo build a specific target in Release configuration with static Swift standard library linking:
scd build --target MyLibrary --configuration Release --static-swift-stdlib