I have an app bundle file, now I want to generate a universal APK that can be installed to all devices. I have tried to use this command to generate universal APK:
$bundletool build-apks --bundle=myapp_bundle.abb --output=myapp.apks --universal
However, what I got is .apks (not .apk) where I cannot install directly to any devices. Anyone know how to get a universal .apk file instead of .apks?
Thank you very much.
App bundles are publishing format, whereas APK (Android application Package) is the packaging format which eventually will be installed on device. Google uses app bundle to generate and serve optimized APKs for each user's device configuration, so they download only the code and resources they need to run your app.
Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file.
A universal APK contains code and resources for all ABIs in a single APK. The default value is false . Note that this option is only available in the splits.
Use --mode=universal in place of --universal. For example, you can run something like this:
bundletool build-apks --bundle=myapp_bundle.aab --output=myapp.apks --mode=universal
At the end you have myapp.apks, this file is something like a zip file. You can extract the content into a folder, for example:
unzip out.apks -d apks
Now in the folder apks you have only one apk, in my case universal.apk, that you can install as usual on any device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With