4

My APK file is already signed (with jarsigner) and compressed (with zipalign). I do it via a bash script. Though I'm getting a warning in Play Console to use Android App Bundle:

Reduce the size of your next release using the Android App Bundle. Your app could be 15.4% smaller if you used the Android App Bundle.

I know I have to use bundletool to use it in command line. The documentation is though too long and cumbersome.

Imagine I have such a file myApp.apk (already signed and compressed). Which command should I run to have the Android App Bundle file to upload to Google Play Console?

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109

2 Answers2

16

It's very simple. You can create android app bundles (.aab) file from android source by this command :

gradlew bundle

OR

gradle bundle
Emamie
  • 2,792
  • 1
  • 19
  • 17
1

You cannot simply convert an APK to an App Bundle. You have to use a build system that supports building App Bundles from source, like Android Studio (which uses Android Gradle plugin) or others.

Bundletool has a build-bundle command but it is meant to use by build systems since you need already precompiled dex code, and resources compiled in a proto format.

Pierre
  • 15,865
  • 4
  • 36
  • 50