16

in my android app if I want to update APK file I use this:

adb install -r some_my.apk

Nice. It's work. Now I sign my bundle and as result Android Studio 3.5. generate : AAB (Android App Bundle) file. Nice.

Now I install prev app from Google Play. And I want to update my app by AAB.

How I can do this?

If I try this:

adb install -r some_my.aab

I get error:

adb.exe: need APK file on command line
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Alexei
  • 14,350
  • 37
  • 121
  • 240

1 Answers1

16

Android App Bundles is a publishing format and you can't install the aab file on a device.

You can check the official doc.

An app bundle is different from an APK in that you can’t deploy one to a device. Rather, it’s a upload format that includes all your app’s compiled code and resources in a single build artifact.

You can extract the apks files from the aab file using the bundletool command.

To generate an APK set for all device configurations (signed with a debug key) you can use:

bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks

To deploy your app from an APK set, use the install-apks

bundletool install-apks --apks=/MyApp/my_app.apks
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • 1
    If anyone else is looking for it, the official docs (https://developer.android.com/studio/command-line/bundletool) say you can download it from here - https://github.com/google/bundletool/releases – Damien Sawyer Jul 28 '21 at 21:11