如何在设备上部署 aab 文件?

How to deploy an aab file on device?

在我的 android 应用中,如果我想更新 APK 文件,我使用这个:

adb install -r some_my.apk

不错。是工作。 现在我签署了我的包,结果 Android Studio 3.5。生成:AAB (Android App Bundle) 文件。 不错

现在我从 Google Play 安装上一个应用程序。我想通过 AAB.

更新我的应用程序

我该怎么做?

如果我尝试这样做:

adb install -r some_my.aab

我收到错误:

adb.exe: need APK file on command line

Android App Bundle 是一种发布格式,您不能在设备上安装 aab 文件。

您可以查看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.

您可以使用 bundletool 命令从 aab 文件中提取 apks 文件。

要为所有设备配置(使用调试密钥签名)生成 APK 集,您可以使用:

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

要从 APK 集部署您的应用程序,请使用 install-apks

bundletool install-apks --apks=/MyApp/my_app.apks