Search code examples
androidadbgoogle-play-consolebundletool

Build Android App bundle from the command line


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?


Solution

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

    gradlew bundle
    

    OR

    gradle bundle