当前位置:   article > 正文

打包aab,从AAB文件生成Apk文件(Android应用程序捆绑包)

aabfdfeec6a3edee75eb388a5c9f5af2

Is there any way to generate an apk file from android app Bundle via terminal or using android studio?

解决方案By default, the IDE does not use app bundles to deploy your app to a

local device for testing

Refer bundletool command

For Debug apk command,

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

For Release apk command,

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

--ks=/MyApp/keystore.jks

--ks-pass=file:/MyApp/keystore.pwd

--ks-key-alias=MyKeyAlias

--key-pass=file:/MyApp/key.pwd

Edit:

I have been using following commands while testing my release build for aab(I hope it helps others too):

Download bundletool jar file from Github Repository (Latest release > Assets > bundletool-all-version.jar file). Rename that file to bundletool.jar

Generate your aab file from Android Studio eg: myapp-release.aab

Run following command:

java -jar "path/to/bundletool.jar" build-apks --bundle=myapp-release.aab --output=myapp.apks --ks="/path/to/myapp-release.keystore" --ks-pass=pass:myapp-keystore-pass --ks-key-alias=myapp-alias --key-pass=pass:myapp-alias-pass

myapp.apks file will be generated

Make sure your device is connected to your machine

Now run following command to install it on your device:

java -jar "path/to/bundletool.jar" install-apks --apks=myapp.apks

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/510571
推荐阅读
相关标签
  

闽ICP备14008679号