Skip to content

Running SPM Executables

scd can automatically build, archive, and run executable products on the host platform or on an Android device or emulator. This is done with the run command.

run accepts the same SPM Build Options and Libraries Options as build and archive, and uses them when preparing the file tree archive that contains the executable product before running it.

Use --product to specify which executable product to run. For example, to run a specific product on the host platform:

Terminal window
scd run --product MyExecutable

To run a specific product on a connected Android device or emulator:

Terminal window
scd run --platform android-arm64-v8a --product MyExecutable

If --product is omitted, scd automatically runs the project’s single executable product. This only works when the project has exactly one — if there’s more than one, --product must be specified:

Terminal window
scd run
scd run --platform android-arm64-v8a