Skip to content

Android Builds

Build and submit Android apps to Google Play Store using Capgo’s dedicated infrastructure.

  • You will learn how to upload your app via Capgo Native build
  • You will learn how to configure the credentials for Capgo Native Build
  • You need to have an active Google Developer account
  • You need to have Android Studio installed
  • Your app must be able to build successfully with Android Studio

Before we can start thinking about building the app with Capgo, we should first set it up, and do a first Android build by hand. There are some advantages to doing a manual build first:

  • You will prepare the credentials for the later Capgo build
  • You will create a record on the Play Store Console

Building the app manually with Android Studio

Section titled “Building the app manually with Android Studio”

Before we can start building the app with Capgo, we need to build the app manually with Android Studio.

  1. Open Android Studio

    Run bunx cap open android to open the Android Studio project.

  2. Click on Build -> Generate Signed App Bundles / APKs Android Studio generate signed app bundles / APKs

  3. Select Android App Bundle and click on Next Android Studio select Android App Bundle

Right now, you are missing the keystore file. This file is used to sign your app, which lets Google know that it’s you who built the app. To generate it, we will use the GUI method provided by Android Studio. There is also a way to do this with the command line, but we will not cover that in this tutorial.

  1. Click on Create new Android Studio create new keystore

  2. Fill in the Key Store path Android Studio fill in key store path

  3. Set the Key Store password Android Studio set key store password

  4. Fill the rest of the form

    1. Keep the Key Alias as is (key0)
    2. Fill the certificate details. I have filled it with fake details, but you should fill it with your own details.

    Android Studio fill rest of the form

  5. Click on OK Android Studio click on OK

  1. Make sure all of the details for the keystore have been filled in correctly and click on Next Android Studio make sure all of the details for the keystore have been filled in correctly

  2. Select the release build variant and click on Create Android Studio select release build variant

  3. After the build succeeds, you should see the following screen Android Studio after build succeed

    1. This popup indicates that the build succeeded.
    2. Click on the locate button - this will open the file explorer and you should see the build there.
  4. Make sure you can see the build in the file explorer Android Studio make sure you can see the build in the file explorer

RequirementFlagDescriptionRequired
Keystore file--keystore <path>Path to your .jks/.keystore file used to sign the APK/AAB.Yes
Keystore alias--keystore-alias <alias>Alias name of the key inside the keystore.Yes
Keystore key password--keystore-key-password <password>Password for the key. If key/store passwords match, you can provide only one.Look at the note below
Keystore store password--keystore-store-password <password>Password for the keystore. If key/store passwords match, you can provide only one.Look at the note below
Google Play service account--play-config <path>JSON service account file for Play Store uploads.Yes
Terminal window
bunx @capgo/cli build credentials save --platform android \
--keystore ./path/to/keystore.jks \
--keystore-alias "your-alias" \
--keystore-key-password "key-password" \
--keystore-store-password "store-password" \
--play-config ./play-store-service-account.json

Keystore, keystore password, keystore key password, keystore alias

Section titled “Keystore, keystore password, keystore key password, keystore alias”

If you have followed the manual build instructions, you should have the keystore already generated. If you have not followed the instructions, please follow them to generate the keystore.

Generating the Google Play service account is a manual and complex process. Yet, it is required to upload your app to Google Play. Please keep in mind the following things:

  • You NEED to be the owner of the Developer Account. Otherwise, you will not be able to setup the service account.
  • You will need to create a new Google Cloud Project (separate from your Google Play Account)

Let’s begin.

  1. Go to Google Cloud Console

  2. Click on the project selector Google Console Project Selector

  3. If you already have a project, select it. Otherwise, create a new project:

    1. Click on New project New Project button in Google Console
    2. Name your project and click Create Project naming screen showing name field and Create button
    3. Ensure that you are on the right project Project name showing in the selector indicating correct project selection
  4. Let’s click on the search bar and search for service accounts and click on it Google Console search bar Google Console search bar

  5. Let’s click on Create service account Create Service Account button in Google Console

  6. Fill in the form for the service account and click on Done

    1. I recommend setting the name to Capgo Native Build Service Account
    2. For the Service Account ID, I recommend setting it to capgo-native-build-service-acc
    3. As for the description, you don’t have to fill it in, but I recommend filling it with Allows Capgo Native Build to build and submit the app to the Play Store

    Google Console fill in the form for the service account

  7. Click on the newly created service account You should now see the newly created service account in the list. Click on it. Google Console newly created service account

  8. Click on the Keys tab Keys tab in Google Console

  9. Click on Add Key and Create new key Google Console add key and create new key

  10. Click on JSON and Create Create Key button in Google Console

  11. Download the JSON file The JSON file should have been downloaded automatically. You can click on close to close the window. Google Console download key

You can save the credentials using the following command:

Terminal window
bunx @capgo/cli build credentials save --platform android \
--keystore ./path/to/keystore.jks \
--keystore-alias "your-alias" \
--keystore-key-password "key-password" \
--keystore-store-password "store-password" \
--play-config ./play-store-service-account.json