Q: How to convert an Android App bundle to APKS for debugging or adb installation?
Android bundle file type, *.aab, is a package that includes multiple optimised APKS for Google Play Store deployment. It compresses files into a smaller size to smoothen the download process from Play Store. For more details, you can navigate to the Google official document: https://developer.android.com/guide/app-bundle
In order to debug your application, you may need to use the ADB command to manually install the app onto devices or simulators. However, ADB doesn’t support .aab file format and you will need to convert it back to APKS before installing it.
The process is simple as below:
1. Generates APKS from Bundle file
bundletool build-apks --bundle=<PATH_OF_AAB> --output=<PATH_OF_APKS_OUTPUT> --ks <PATH_OF_KEYSTORE> --ks-key-alias=bs --ks-pass=pass:<KEYSTORE_PASSWORD> --key-pass=pass:<SIGNING_KEY_PASSWORD> # Arguments: # PATH_OF_AAB = The filepath of the Android bundle .aab file # PATH_OF_APKS_OUTPUT = The destination of APKS output file # PATH_OF_KEYSTORE = The filepath of keystore used in signing the bundle # KEYSTORE_PASSWORD = The passphase of the keystore # SIGNING_KEY_PASSWORD = The passphase of the singing key
2. Install the APKS to devices/simulators
bundletool install-apks --apks=<PATH_OF_APKS> # Arguments: # PATH_OF_APKS = The filepath of the Android APKS .apks file
Then you should now have your App installed ready for debugging.