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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值