- Install a JDK distribution of your choice
- Download the Android command line tools (scroll down a bit), extract it to
~/Android/Sdk(or somewhere else, this is just where Android Studio puts it), and set theANDROID_HOMEenvironment variable to~/Android/Sdk. - Accept licenses by running
$ANDROID_HOME/cmdline-tools/bin/sdkmanager --licenses --sdk_root=$ANDROID_HOME. - Check the ndk version required for the commit you have checked out (it's listed in listed in
android/app/build.gradle.kts, Ctrl-F ndkVersion) and download that version of the ndk, extract it to$ANDROID_HOME/ndk/your_ndk_version_number(and ensure symlinks are preserved), and set theANDROID_NDK_HOMEenvironment variable to$ANDROID_HOME/ndk/your_ndk_version_number.
- Ensure the version of ndk listed in
android/app/build.gradle.kts(Ctrl-F ndkVersion) is installed (File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools).
If it's inconvenient to install the latest version of just, use the without just instructions. The catch is that the without just instructions are more likely to change in the future, so if you're packaging openscq30 and the latest version of just is easily available, prefer the with just instructions.
- Install rustup
- Add all supported cpu architecture targets that you plan to build:
rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android - Install cargo-ndk:
cargo install cargo-ndk
- In the
androiddirectory, run./gradlew assembleReleasefor a universal apk, or one or more of these for a specific cpu architecture:
./gradlew assembleRelease-arm64-v8a./gradlew assembleRelease-armeabi-v7a./gradlew assembleRelease-x86_64./gradlew assembleRelease-x86
- The apk can be found at
android/app/build/outputs/apk/release/app-release-unsigned.apkfor a universal apk orandroid/app/build/outputs/apk/release-arm64-v8a/app-release-arm64-v8a-unsigned.apkfor example otherwise.
- In the project root directory, run one or more of these commands:
just build-android: builds all of the followingjust build-android-universal: builds a single apk supporting all of the following architecturesjust build-android-arm64-v8ajust build-android-armeabi-v7ajust build-android-x86_64just build-android-x86
- The apks can be found at
build-output/openscq30-android-*.apk