When submitting your app on Catappult, it is required that the file you upload is not an Android App Bundle (AAB/ .aab).
For this reason, we will explain below how to extract the APKs that you will need to publish your app on our platform. To do this, you will be using the bundletool.
If you do not have access to your Key Store, do not follow this guide
If you do not have access to your Key Store and use Google Play's signature, do not follow the instructions below. To get the standalone APK while using Google Play's signature, follow this guide: Download your app from Google Play Console.
The bundletool is a tool that allows you to convert an AAB file into several APKs that are then to be deployed onto Android devices. You can download the bundletool from the GitHub repository (click here).
After downloading the .jar file, in order to run it, you need to use the following command on your terminal:
java -jar bundletool-all-1.11.0.jar
To generate the APKs from your .aab file, you must use the build-apks command within bundletool. When using this command, it will generate APKs from your app bundle by including them in a container called an "APK set archive", which uses the .apks file extension. Below you can find an example of how to use it:
java -jar bundletool-all-1.11.0.jar build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
On this command 2 flags were used:
- bundle: path to your .aab file;
- output: path to the .apks file that will be generated.
In order to access the files inside the .apks file just change the file extension to .zip and unzip it. On the unzipped files you will see a folder named splits and within there will be your base APK (base-master.apk) and all its splits.
If, instead, you want to have a standalone APK - a single APK that includes all of your app's code and resources - you need to set the mode to universal as it is shown on the command below:
java -jar bundletool-all-1.11.0.jar build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks --mode=universal
In case you wish to deploy the APKs to Catappult, you need to also include your app's signing information. Below is an example of how to do it:
java -jar bundletool-all-1.11.0.jar build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks --mode=universal --ks=/MyApp/keystore.jks --ks-pass=file:/MyApp/keystore.pwd --ks-key-alias=MyKeyAlias --key-pass=pass:mypassword
On this command 4 new flags were used:
- ks: path to your keystore file
- ks-pass: password for the keystore (ks-pass=pass: if you using it in plain text or ks-pass=file: if you are using a file)
- ks-key-alias: signing key alias/name
- key-pass: password for the signing key (key-pass=pass: if you using it in plain text or key-pass=file: if you are using a file)
Updated about 1 month ago