Android App Bundles arrived in 2018 as a new method for developers to publish their apps. Since then, Google has been promoting their use until a month ago it established that App Bundles would replace APKs on Google Play. The problem is that App Bundles, in AAB format, are not installable on Android.
An App Bundle is in a sense something like a ZIP file with everything needed to create the custom installable APK file for each device. It is possible to convert an App Bundle in AAB to an APK file with the right tools, although it is a somewhat time-consuming process.
What do you need to convert from AAB to APK?
As developers start releasing all their apps in App Bundle format, you may find that you end up with AAB files instead of the usual APKs. For example, in GitHub projects where developer-compiled files are included.
It should be noted that App Bundles are not installable and although developers upload an AAB file to Google Play, what you end up installing on your phone is an APK. The problem and at the same time the advantage of this is that the APK that is downloaded and installed is much more optimized for your mobile configuration and, therefore, takes up less space. Be that as it may, if you end up in your hands an application or game in App Bundle format and you want to convert it to APK to install it, it can be done.
You will need a computer, Java, and a certificate to sign the applications. Sounds complicated, but you will get these last two components if you download and install Android Studio. Android Studio includes Java in its installation and will automatically create your debugging certificate, so it’s a much better option than doing it separately.
In addition, you will need the Bundletool tool, which you can download from GitHub. It is a JAR file, hence you need to have Java installed on your PC before you can use the tool to convert the AAB file to an APK.
How to convert an App Bundle (AAB) to APK?
If you have an application or game in an App Bundle in AAB format and you want to convert it into an APK that you can install on your mobile, the easiest way is to put in the same folder on your PC the AAB file and Bundletool, to avoid having to include the paths.
Then, open that folder in the command line. On Windows, that involves pressing Win + R, typing cmd, and then going to the corresponding folder with a command such as CD C:MyFolder, changing MyFolder to the folder name. Then run the following command:
bundletool build-apks –bundle=application.aab –output=application.apks –mode=universal.
Change in the above command the name of the application.aab to the name of your App Bundle file, while the application.apks you can choose any name, on the condition that it is an APKS file, not APK. We will know why in a moment.
The process will take more or less time depending on the complexity of the application and the speed of the PC, but generally, it will not take more than a few seconds. Bundletool warns you that the Android Studio debug certificate will be used, although you can sign the application with any other key if you want. You can see the Bundletool documentation on the Android Developers website.
Once the process is finished, you will have an APKS file with the name you have chosen. It is not an APK, but a ZIP file containing the APK file inside. Rename the APKS file to ZIP and open it with your favorite decompressor.
Unzip universal.apk and you will have the APK file generated from the App Bundle. Note, however, that it is signed with a debug key that is different from the developer’s key, so you will not be able to update over previous versions or install over official versions.