Blog Infos
Author
Published
Topics
Published
Topics

Let’s suppose that for some reason we are interested in doing some tests with the version of Android that is in production and we cannot install it directly from the Play Store because it is being published progressively, one option is to download the AAB file from the Google Play Console and generate the APK.

To generate the APK, we will need the signing key and install the bundletool.

What is bundletool

bundletool is a tool used by Android Studio and Google Play to compile an Android App Bundle.

bundletool can be used via the command line, allowing us to generate an APK from an AAB.

How to install bundletool

It is possible to download it from the GitHub repository and run the jar file.

On the other hand, if you have MacOS, the easiest way to install bundletool is through Homebrew, a package manager. In this case, once Homebrew is installed, simply run in the terminal:

$ brew install bundletool

During the installation, it will notify us if the tool is not in the PATH and, if so, how to solve it.

How to create an APK from AAB using bundletool

Once installed, run the following command in the terminal:

$ bundletool build-apks --bundle=/MyApp/app-release.aab --output=/MyApp/app_release.apks --mode=universal

The --bundle=path and --output=path are required and the --mode=universal is optional, but in this case, it will be required because it is necessary to create a single APK with all the resources and code of the app. Otherwise, it will generate multiple APKS based on different device configurations, e.g. language or screen size.

Once executed, an APKS file is generated in the path indicated in the output.

Universal APK from the AAB

To finish, we just have to unzip the APKS file that contains the APK whose name is universal.

APK from AAB on Android using bundletool

This article was originally published on proandroiddev.com on October 30, 2022

Job Offers

Job Offers

There are currently no vacancies.

OUR VIDEO RECOMMENDATION

,

App Quality – What I found when I look into your APK

Sharing some best practice / anti-practice about App Quality by looking into the APKs of some famous apps.
Watch Video

App Quality – What I found when I look into your APK

Fung Lam
Developer Relations Engineer
Google

App Quality – What I found when I look into your APK

Fung Lam
Developer Relations ...
Google

App Quality – What I found when I look into your APK

Fung Lam
Developer Relations Engin ...
Google

Jobs

YOU MAY BE INTERESTED IN

YOU MAY BE INTERESTED IN

blog
Lots of Android apps offer in-app purchases to users for the premium features or…
READ MORE
Menu