:class: information
The simplest option to build AAPS is the [Browser build](./BrowserBuild.md) alternative.
Tested with Fedora and Debian Linux, other systems should work with minimal adjustments.
Consult the minimum required Java version from this table. Install the appropriate OpenJDK package using the system package manager. For example in Debian, the packages are named like openjdk-21-jdk. It should include javac and keytool binaries.
Download the Android Command line tools package from the Android Studio page. Android Studio itself is not required. More information about installing this package is found in sdkmanager docs. After the package is installed, you should manually set two environment variables: ANDROID_HOME and PATH. Finally, run sdkmanager --licenses to finish the installation.
If you already have a keystore file for signing AAPS, reuse that.
keytool -genkeypair -v \
-keystore aaps-keystore.jks \
-alias aaps-key \
-keyalg RSA \
-keysize 4096 \
-validity 20000You will need the keystore file and passphrase every time you update AAPS.
Clone the git repo if not already cloned. AAPS uses master branch for the latest stable version, ensure you are on the branch/tag you want to build.
Run ./gradlew :app:assembleFullRelease in the repo. It automatically downloads Gradle, dependencies, and then compiles the code. When the build succeeds, you should have an unsigned APK at app/build/outputs/apk/full/release/app-full-release-unsigned.apk. It should have also installed an apksigner binary to $ANDROID_HOME. Update your PATH again.
Change to your home directory and create a signed APK file:
apksigner sign \
--ks path/to/aaps-keystore.jks \
--ks-key-alias aaps-key \
--out app-full-release-signed.apk \
./AndroidAPS/app/build/outputs/apk/full/release/app-full-release-unsigned.apkNow you have app-full-release-signed.apk ready for installation or upgrade.