Android – Generate Apk file from aab file (android app bundle)

androidandroid-app-bundleandroid-studioapk

Is there any way to generate an apk file from android app Bundle via terminal or using android studio?

Best Answer

So far nobody has provided the solution to get the APK from an AAB.

This solution will generate a universal binary as an apk.

  1. Add --mode=universal to your bundletool command (if you need a signed app, use the --ks parameters as required).

    bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
        --mode=universal
    
  2. MAIN STEP: Change the output file name from .apks to .zip

  3. Unzip and explore

  4. The file universal.apk is your app

This universal binary will likely be quite big but is a great solution for sending to the QA department or distributing the App anywhere other than the Google Play store.