# Update to a new version or branch ## Build yourself instead of download **AAPS** is not available to download, due to regulations concerning medical devices. It is legal to build the app for your own use, but you must not give a copy to others! See [FAQ page](../UsefulLinks/FAQ.md) for details. ## Important notes * Please update to the new version of **AAPS** as soon as possible after a new release is available. * When a new release is available, in the **AAPS** app itself, you will receive an information banner about the new version. * The new version will also be announced on Facebook at the time of release. * Following the release, please read the [Release Notes](ReleaseNotes.md) in detail, and clarify any queries with the community on Facebook or Discord, before proceeding with the update. ```{note} 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 ```{contents} Steps for updating to a new version of AAPS :depth: 1 :local: true
In case you experience problems, see separate page for [troubleshooting Android Studio](../GettingHelp/TroubleshootingAndroidStudio). ### Export your settings Export your settings from the existing **AAPS** version on your phone. You might not need it, but better be safe than sorry. See the [Export & import settings](ExportImportSettings.md) page if you don't remember how to do this. ### Check your Android Studio version The minimal version required is described in the [Building Instructions](#Building-APK-recommended-specification-of-computer-for-building-apk-file). If your version is older, please [update Android Studio first](#Building-APK-install-android-studio)! (Update-to-new-version-update-your-local-copy)= ### Update your local copy ```{admonition} WARNING :class: warning If you update from versions prior to 2.8.x, please follow the instructions to do a [New clone](../Installing-AndroidAPS/building-AAPS), as this guide will not work for you! * Open your existing AAPS project with Android Studio. You might need to select your project. (Double) click on the AAPS project. ![Android Studio - Select Project](../images/update/01_ProjectSelection.png) * In the menu bar of Android Studio, select Git -> Fetch ![Android Studio Menu - Git - Fetch](../images/update/02_GitFetch.png) * You will see a message in the lower right corner that Fetch was successful. ![Android Studio Menu - Git - Fetch successful](../images/update/03_GitFetchSuccessful.png) * In the menu bar, now select Git -> Pull ![Android Studio Menu - Git - Pull](../images/update/04_GitPull.png) * Leave all options as they are (origin/master) and select Pull ![Android Studio - Git - Pull dialog](../images/update/05_GitPullOptions.png) * Wait while download is in progress, you will see this as info in the bottom bar. When it's done, you will see a success message. ```{note} The files that were updated may vary! This is not an indication ``` ![Android Studio - Pull successful](../images/update/06_GitPullSuccess.png) * Gradle Sync will be running to download some dependencies. Wait until it is finished. ![Android Studio - Gradle Sync](../images/studioSetup/40_BackgroundTasks.png) ### Check JVM version This check is particularly indicated if you have already built a previous version of **AAPS** on the same computer. Check in the [Building Instructions](#Building-APK-recommended-specification-of-computer-for-building-apk-file) the required version for JVM, matching the **AAPS** version you are now building. Then follow the steps described at [Incompatible Gradle JVM](#incompatible-gradle-jvm) to make sure you currently use the correct version. (Update-to-new-version-build-the-signed-apk)= ### Build the Signed APK Your sourcecode is now the current released version, and all prerequisites have been checked. It's time to build the signed apk as described in the [build signed apk section](#Building-APK-generate-signed-apk). (Update-to-new-version-transfer-and-install)= ### Transfer and install the apk You need to transfer the apk to your phone so you can install it. ```{note} If you completed the build with the same existing key store in Android Studio, then you do not need to remove the existing app on your phone. When you install the apk, follow the prompts to install updates. For other scenarios such as establishing a new key store in Android Studio for your signed apk, you will need to delete the old app before installing the apk. **Make sure to export your settings!** ``` See the instructions for [transferring and installing AAPS](../SettingUpAaps/TransferringAndInstallingAaps.md) (Update-to-new-version-check-aaps-version-on-phone)= ### Check AAPS version on phone After you installed the new apk, you can check the AAPS version on your phone by clicking the three dots menu on the top right and then About. You should see the current version. ![AAPS version installed](../images/Update_VersionCheck.png) Check in the [Release Notes](../Maintenance/ReleaseNotes.md) if there are any specific instructions after update. ## Troubleshooting If anything goes wrong, don't panic. Take a breath! Then see the separate page [troubleshooting Android Studio](../GettingHelp/TroubleshootingAndroidStudio) if your problem is already documented! If you need further help, please reach out to other **AAPS** users on [Facebook](https://www.facebook.com/groups/AndroidAPSUsers) or [Discord](https://discord.gg/4fQUWHZ4Mw).