← AAPS Atlas search

Browser build

Mirrored from https://wiki.aaps.app/en/latest/SettingUpAaps/BrowserBuild.html — community documentation, not medical advice.


Building AAPS with GitHub Actions.

Minimum AAPS version supported is 3.3.2.1.

Build yourself instead of download

The AAPS app (an apk file) is not available for download, due to regulations around 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 for details.

Device and software specifications for building AAPS

We recommend using an Android device. You can also use a computer or an iOS device.

You will need to use multiple tabs in your browser, and switch from one to the other. Example Chrome:

You also need a Google account so that the app can be saved in your Google Drive.

Note

This wiki assumes you’re performing all operations with your cellular phone and the Chrome web browser.

You will need to jump from tab to tab: start with all tabs closed to avoid losing yourself when switching from one to another.

1. AAPS personal fork

You will need to secretly store your personal Android Java Key and Google Drive information in GitHub (later in the process, we will explain how).

Since this cannot be done inside the public repository of AndroidAPS, you need to make your personal copy of the source code (called a fork).

GitHub account

You need to create a GitHub account if you don’t have one yet.

You can sign up with your email, or you can sign up with Google. Follow the registration and verification process.

When you have an account, sign in to GitHub .

Fork AndroidAPS

Open the official AndroidAPS repository following this link .

Tap on the fork icon. This will create a copy inside your own account.

Scroll down the next screen and tap Create Fork .

Note: you can unselect “Copy the main branch only” if you will want to build developers versions or customizations.

Note

You cannot fork and you see this?

Create a new fork

A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. View existing forks.

Required fields are marked with an asterisk (*).

No available destinations to fork this repository.

This means you already have an existing fork of AndroidAPS.

Make sure it’s up to date and continue to Preparation Steps.

Warning

Never delete your fork without having done a backup of your secrets!

GitHub now displays your personal copy of AndroidAPS. Leave this web browser tab open.

2. Preparation Steps

File Manager Plus

Install File Manager Plus from the Google Play store.

The app is necessary for the preliminary phase and you can safely delete it from your phone once you’ve successfully build and installed AAPS.

Check this is the correct app and tap Install, then Open.

Tap Next to accept the Privacy Policy.

Tap Next to allow the app to access the phone files.

Switch to enable access to all files.

Allow File Manager + notifications.

Consent to profiling.

Note

<https://github.com/nightscout/aaps-ci-preparation/releases/download/release-v1.1.2/aaps-ci-preparation.html>

Or visit the latest release page:

<https://github.com/nightscout/aaps-ci-preparation/releases/latest>

2.Backup copy hosted on this site:

aaps-ci-preparation.html

AndroidAPS build requires private keys, that are stored in a Java KeyStore (JKS):

Warning

Building AAPS with Option 1 will not allow you to upgrade your existing AAPS. You will need to:

The AAPS app will be saved in your Google Cloud drive once built.

AAPS-CI Option 1 – Generate JKS

Android

Compatible with Android (The simplest, recommended as the first choice)

Wiki

Open the CI preparation help file

With File Manager+, open the file aaps-ci-preparation-html you downloaded above.

Select Downloads.

And search for this file, tap it to open it, open it with Chrome, tap Just once.

It will open like this.

Select Generate JKS. The field below will populate with characters.

Keep this tab open.

Create a new secret in GitHub

Return to your GitHub browser tab: your own AndroidAPS copy.

Scroll down to Security and select Secrets and variables.

Now select Actions

Scroll down to Repository secrets and tap New repository secret

You will see this dialog (scroll down if it’s not visible).

Leave the tab opened like this.

Switch to the File Explorer Plus tab.

Tap the top Copy button.

Switch back to the GitHub tab.

In the Name field, paste the text you just copied. Use a long touch on the text box to show the paste menu.

Switch to the File Explorer Plus tab.

Tap the second Copy button.

Switch back to the GitHub tab.

Check the secret has been added, scroll down to verify.

Video

iOS

Compatible with iOS (using iPad as an example)

Computer

Use a computer (supports Windows/Mac/Linux)

Open the webpage <https://simplewebserver.org/download.html>

Install Simple HTTP Server

If you are a Windows/Mac user, you can install it from the store.

After clicking the link, you will be asked whether to allow opening it. Please choose Open Link.

Example on Mac:

<http://127.0.0.1:8080/aaps-ci-preparation.html>

Skip the next section and continue here .

---### AAPS-CI Option 2 – Upload Existing JKS

KEY + PASSWORDS

Android

Compatible with Android (The simplest, recommended as the first choice)

Wiki

Copy your Android Studio key in your Google Cloud drive

On your computer, search for the keystore file you used to build AAPS. It is named with the extension .jks .

Drag it into your Google Drive , either inside the browser or your mapped Google Drive.

Open File Manager Plus and select Cloud.

Add a Cloud location.

Choose Google Drive.

Select your Google Drive account email. Tap OK.

Your Google Cloud drive should display its contents. Now return to the app home page.

Open the CI preparation help file

Open the file aaps-ci-preparation-html you downloaded above.

Select Downloads.

And search for this file, tap it to open it, open it with Chrome, tap Just once.

It will open like this.

Scroll down to Option 2: Upload Existing JKS. Expand the interface.

Select Choose File.

Pick your KeyStore file from your Google Drive files.

The field below will populate.

Keep this tab open.

Create a new secret in GitHub

Return to your GitHub browser tab: your own AndroidAPS copy.

Scroll down to Security and select Secrets and variables.

Now select Actions

Scroll down to Repository secrets and tap New repository secret

You will see this dialog (scroll down if it’s not visible).

Leave the tab opened like this.

Switch to the File Explorer Plus tab.

Tap the top Copy button.

Switch back to the GitHub tab.

In the Name field, paste the text you just copied. Use a long touch on the text box to show the paste menu.

Switch to the File Explorer Plus tab.

Tap the second Copy button.

Switch back to the GitHub tab.

Check the secret has been added, scroll down to verify.

Add a new secret: tap the New repository secret button.

Switch to the File Explorer Plus tab.

Tap the top Copy button to copy KEYSTORE_PASSWORD .

Note: if you’re comfortable with typing the key names directly in GitHub you don’t need to Copy/Paste. If you’re not sure you will type exactly the same key name, continue like this. Note that you shouldn’t leave : at the end of the key name.

Switch back to the GitHub tab.

Check the secret has been added, scroll down to verify.

Tap the New repository secret button shown above.

Switch to the File Explorer Plus tab.

Tap the top Copy button to copy KEYSTORE_ALIAS .

Switch back to the GitHub tab.

Check the secret has been added, scroll down to verify.

Tap the New repository secret button shown above.

Switch to the File Explorer Plus tab.

Tap the top Copy button to copy KEY_PASSWORD .

Switch back to the GitHub tab.

Check the secret has been added, scroll down to verify.

Video

Computer

Use a computer (supports Windows/Mac/Linux)

Install Simple HTTP Server

If you are a Windows/Mac user, you can install it from the store. After clicking the link, you will be asked whether to allow opening it. Please choose Open Link.

Example on Mac:

<http://127.0.0.1:8080/aaps-ci-preparation.html>

AAPS-CI Google Drive Auth

Warning

No matter which of the prior sets of instructions you followed (option 1 or option 2), you MUST add the Google Drive authorization to successfully use the Browser Build.

Note: If you already followed this part in the video, you can now skip to here .

Return to the File Explorer Plus tab.

Scroll down to the Google Drive Auth section and tap Start Auth.

Select your Google account.

Scroll down and accept the access. The web page needs it to obtain the Google Drive authentication key.

Tap Continue.

The GDRIVE_OAUTH2 field will populate, tap the top Copy button.

Switch back to the GitHub tab.

Scroll down to Repository secrets and tap New repository secret.

If you followed Option 1 you should see this:

If you followed Option 2 there will be more keys:

In the Name field, paste the text you just copied. Use a long touch on the text box to show the paste menu.

Switch to the File Explorer Plus tab.

Tap the second Copy button.

Switch back to the GitHub tab.

You should have either two (option 1) or five (option 2) secrets entries now.

GitHub will now be able to store the AAPS apk file in your Google Drive, once built.

AAPS-CI GitHub Actions to Build the AAPS APK

Wiki

Run the Workflow to Build the Signed APK

Install the AAPS APK

Video

Build Version selection

Only AAPS versions from 3.3.2.1 and above will build with the Browser method.

Build Variants selection

Note: both Android and Android Wear apps will be built automatically.

Variants ending with “Debug” indicates that the APK will be built in debug mode, which is useful for developers for troubleshooting.

AAPS-CI Troubleshooting

aaps-ci-preparation web page

Google Refresh Token Expired

Disable Software That May Interfere With OAUTH Verification

Check GitHub Actions Permission Settings

actions/checkout@v4 and actions/setup-java@v4 are not allowed to be used in xxxxx/AndroidAPS . Actions in this workflow must be: within a repository owned by xxxxx

---Warning

Customizations are usually not necessary. This is for your information ony.

If you want to add a specific commit to your branch, please use cherry-pick

CI KeyStore Export

If you want to export your stored keystore, use this method.

This script will export your previously configured keystore information (from Option 1 or Option 2) as a password-protected ZIP file to the /AAPS/KeyStore directory in your Google Drive.

Warning

Before using this export method, make sure your keystore and Google Drive settings have been completed.

Steps