5
votes

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.

2
Solved, needs to create universal_apk directory and unzip the .apks bundle and you will get your universal apk, follows this command: $ unzip myapp.apks -d universal_apkhallz12
i am not able install the bundle tool. pls help me.Manmohan Soni
java -jar bundletool-0.10.4.jar extract-apks ...Pierre

2 Answers

4
votes

Use either the extract-apks or the install-apks command to respectively extract the APK from the APK Set to a directory, or install them on a connected device.

Alternatively, just unzip the .apks using your favourite zip tool. But that might not always work in the future.

16
votes

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.