Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Universal APK from Android App Bundle

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.

like image 490
hallz12 Avatar asked May 31 '18 04:05

hallz12


People also ask

What is difference between APK and app bundle?

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.

How do I create a .AAB file?

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.

What is a universal APK?

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.


1 Answers

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.

like image 55
Noel Moreno Lemus Avatar answered Oct 06 '22 22:10

Noel Moreno Lemus