diff --git a/docs/EN/Maintenance/DocumentationUpdate.md b/docs/EN/Maintenance/DocumentationUpdate.md index 4b42a1d08b6e..8e22ef610f03 100644 --- a/docs/EN/Maintenance/DocumentationUpdate.md +++ b/docs/EN/Maintenance/DocumentationUpdate.md @@ -1,5 +1,10 @@ # Docs updates & changes +## March 2026 + +- [Add CLI Build option](../SettingUpAaps/CLIBuild.md) @je-l +- Rename *Computer Build* to *Android Studio Build*. Preserve file names for URLs. + ## January 2025 - [3.4](#version3400) release and documentation update roll-up (Wizard, Computer build versions, Config Builder) diff --git a/docs/EN/Maintenance/UpdateComputerBuild.md b/docs/EN/Maintenance/UpdateComputerBuild.md index f55f4f858339..4a3e6af7f633 100644 --- a/docs/EN/Maintenance/UpdateComputerBuild.md +++ b/docs/EN/Maintenance/UpdateComputerBuild.md @@ -1,4 +1,4 @@ -# Update with a computer +# Update with Android Studio ## Build yourself instead of download @@ -8,7 +8,7 @@ In case you want to build **AAPS** on a new computer : copy your back-up keystore file to the new computer. Then follow the [Initial build **AAPS** procedure](../SettingUpAaps/BuildingAaps.md) instead of this guide. With the only difference that instead of creating a new keystore, you can select the one you have copied on the new computer. ``` -## Overview for updating to a new version of AAPS with a computer +## Overview for updating to a new version of AAPS with Android Studio ```{contents} Steps for updating to a new version of AAPS :depth: 1 diff --git a/docs/EN/Maintenance/UpdateToNewVersion.md b/docs/EN/Maintenance/UpdateToNewVersion.md index dbee113de03e..37a8118b9ab0 100644 --- a/docs/EN/Maintenance/UpdateToNewVersion.md +++ b/docs/EN/Maintenance/UpdateToNewVersion.md @@ -15,10 +15,14 @@ If you already built your AAPS app with the Browser Build method, follow [these instructions](./UpdateBrowserBuild.md). -## Update AAPS with a computer +## Update AAPS with Android Studio Follow [these instructions.](./UpdateComputerBuild.md). +## Update AAPS with the command-line + +Use the [same instructions](../SettingUpAaps/CLIBuild.md) as when building AAPS previously, but pull new changes with git. + (Update-to-new-version-check-aaps-version-on-phone)= ### Check AAPS version on phone diff --git a/docs/EN/SettingUpAaps/BuildingAaps.md b/docs/EN/SettingUpAaps/BuildingAaps.md index aa95e0cf7c3a..639d0575d27f 100644 --- a/docs/EN/SettingUpAaps/BuildingAaps.md +++ b/docs/EN/SettingUpAaps/BuildingAaps.md @@ -8,9 +8,9 @@ See [FAQ page](../UsefulLinks/FAQ.md) for details. --- -Two methods are available to build the AAPS app: +Three methods are available to build the AAPS app: -### Build with a browser +### Build with a browser (recommended) You can build the app with your smartphone using GitHub actions, and save it in your Google Drive. @@ -18,9 +18,17 @@ You can build the app with your smartphone using GitHub actions, and save it in ---- -### Build with a computer +### Build with Android Studio -You can build the app with your computer using Android Studio. +You can build the app with your computer using Android Studio. This used to be the only build option, +nowadays Android Studio is mostly used by developers who consider making code changes. **[Follow these instructions.](./ComputerBuild.md)** +---- + +### Build using the command-line + +This option is intended for those who prefer to build AAPS in local command-line, without installing Android Studio. + +**[Follow these instructions.](./CLIBuild.md)** diff --git a/docs/EN/SettingUpAaps/CLIBuild.md b/docs/EN/SettingUpAaps/CLIBuild.md new file mode 100644 index 000000000000..01ee2e523763 --- /dev/null +++ b/docs/EN/SettingUpAaps/CLIBuild.md @@ -0,0 +1,63 @@ +# Build instructions for the command-line + +```{admonition} For users familiar with the command-line and git +: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. + +## Requirements + +Consult the minimum required Java version from [this table](#Building-APK-recommended-specification-of-computer-for-building-apk-file). +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](https://developer.android.com/studio#command-line-tools-only). +Android Studio itself is not required. +More information about installing this package is found in [sdkmanager docs](https://developer.android.com/tools/sdkmanager). +After the package is installed, you should manually set two [environment variables](https://developer.android.com/tools/variables): `ANDROID_HOME` and `PATH`. +Finally, run `sdkmanager --licenses` to finish the installation. + +## Building AAPS with Gradle wrapper + +### 1. Generate a Java keystore file for signing AAPS + +If you already have a keystore file for signing AAPS, reuse that. + +```sh +keytool -genkeypair -v \ + -keystore aaps-keystore.jks \ + -alias aaps-key \ + -keyalg RSA \ + -keysize 4096 \ + -validity 20000 +``` + +You will need the keystore file and passphrase every time you update AAPS. + +### 2. Compile the AAPS APK file + +Clone the [git repo](https://github.com/nightscout/AndroidAPS) 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. + +### 3. Create a signed APK file from the unsigned one + + + +Change to your home directory and create a signed APK file: + +```sh +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.apk +``` + +Now you have `app-full-release-signed.apk` ready for installation or upgrade. diff --git a/docs/EN/SettingUpAaps/ComputerBuild.md b/docs/EN/SettingUpAaps/ComputerBuild.md index 22679e89400a..8621b6c12a6a 100644 --- a/docs/EN/SettingUpAaps/ComputerBuild.md +++ b/docs/EN/SettingUpAaps/ComputerBuild.md @@ -1,4 +1,6 @@ -# Computer Build + + +# Android Studio Build This is the traditional method to build your AAPS app. diff --git a/docs/EN/index.md b/docs/EN/index.md index f10b993e0243..230f235f9a53 100644 --- a/docs/EN/index.md +++ b/docs/EN/index.md @@ -93,7 +93,8 @@ Setting up the reporting server <./SettingUpAaps/SettingUpTheReportingServer.md> - Tidepool <./SettingUpAaps/Tidepool.md> Building AAPS <./SettingUpAaps/BuildingAaps.md> - Browser Build <./SettingUpAaps/BrowserBuild.md> -- Computer Build <./SettingUpAaps/ComputerBuild.md> +- Android Studio Build <./SettingUpAaps/ComputerBuild.md> +- CLI Build <./SettingUpAaps/CLIBuild.md> Transferring and Installing AAPS <./SettingUpAaps/TransferringAndInstallingAaps.md> Setup Wizard <./SettingUpAaps/SetupWizard.md> Your AAPS Profile <./SettingUpAaps/YourAapsProfile.md> @@ -151,7 +152,7 @@ AAPS Release Notes <./Maintenance/ReleaseNotes.md> Documentation updates <./Maintenance/DocumentationUpdate.md> Updating to a new version of AAPS <./Maintenance/UpdateToNewVersion.md> - Browser Update <./Maintenance/UpdateBrowserBuild.md> -- Computer Update <./Maintenance/UpdateComputerBuild.md> +- Android Studio Update <./Maintenance/UpdateComputerBuild.md> ```