You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an emulator: avdmanager create avd -n test -k 'system-images;android-35;default;arm64-v8a' and launch emulator -avd test
Configure
Set your SDK path at <android-sdk> and run script: ANDROID_NDK_HOME=/opt/homebrew/share/android-commandlinetools/ndk/28.2.13676358 ~/Library/org.swift.swiftpm/swift-sdks/<android-sdk>.artifactbundle/swift-android/scripts/setup-android-sdk.sh
Modify makefile arguments according to your preferences
Create a signing key with make keystore
SPM to apk
Modify build: aarch64 to build: armv7 aarch64 x86_64 if you want to build all three architectures
Add missing dependencies to LIBRARIES if you want to use Foundation library, for example. You can identify missing dependencies by checking for dlopen errors in adb logcat
Finally, make run to build, archive, install, run and log application
Emulator
Install image with sdkmanager --install 'system-images;android-27;default;arm64-v8a' where system-images;android-27;default;arm64-v8a is the minimum Android version currently supported by the Swift SDK. To view alternative images, use sdkmanager --list
Create emulator executing avdmanager create avd -n target -k 'system-images;android-27;default;arm64-v8a'. The -n parameter specifies the name for the emulator instance
emulator -avd target to launch instance named target
About
Example of minimal Swift Android application packed into Swift Package Manager