如何从 Android App Bundle 生成的 Google Play 管理中心安装 APK?

How to install APKs from Google Play Console generated from an Android App Bundle?

我目前使用发布格式 .aab 在 Google Play 管理中心上传我的应用更新。我的问题是我找不到下载和安装从 .aab 生成的正确 APK 的方法。

当我像许多人建议的那样从 "Manage Releases" 下载时,它会下载一个 .aab。当我下载特定于设备的 APK 时,它会为我提供三个 APK。 (在我的下载案例中,base.apk、config.en.apk 和 config.xxhdpi.apk)。

基本 APK 可以安装但无法启动。其他 2 个 APK 甚至无法解析。我怀疑,这三个应该作为一个包安装,但我不知道该怎么做。

如何安装这三个 APK 或下载我可以轻松安装的单个 APK?

您可以使用 adb install-multiple 命令安装这些 APK:

adb install-multiple base.apk config.en.apk config.xxhdpi.apk

您可以使用的其他选项:

  • 内部测试轨道,
  • 直接从 Android Studio 部署(select "Deploy APK from app bundle" 在 运行 配置中。

您可以使用 bundle tool to manipulate the app bundle file and install it on your device locally. First, download bundletool from here。应用程序包(.aab 文件)。然后通过 运行

从中生成一组 APK
bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks

Note that the command above creates an APK set of unsigned APKs.

然后你可以通过运行

安装这个APK
bundletool install-apks --apks=/MyApp/my_app.apks

.apks 文件包含所有配置。如果您想为特定设备生成一组 APK,请查看 here