Google Play: Android App Bundle (AAB) format is mandatory for uploading apps

The company recently plans to launch an app for overseas business on the Google store, and I will pre-research the relevant preparations for the launch. According to the requirements of Google Play, starting from August 2021, newly released apps must use the Android App Bundle (AAB) format, that is, .aab format files. Newly released apps no longer support the apk format.

aab overview:

Android App Bundle is an Apk dynamic component packaging technology launched by Google in 2018. It
dynamically assembles apk for your device through an App Bundle file in AAB format for installation. Its essence is to split Apk into multiple modules. Before, a large and complete apk was installed in your mobile phone, but you don’t need so many things. Take out the things you don’t need temporarily, so that Save a lot of resource space. In addition to efficiency and modularity, Android
App Bundle now also provides increased security by rolling out application signing key upgrades for new installations.

how to package aab

Operation steps:
Android studio – Build – Generate Signed Bundle/apk – check Android App Bundle – all the way to next – you can check that an app-release.aab file has been generated in the release directory, and upload this file to the Google store.

Mobile phone installation uses AAB format file

Because .aab cannot be directly installed on the device, but our self-test needs to be verified by real machine testing. So what do you do if you want to install it on your phone? The answer is that you need to convert it into .apks through the tool command, and then use the tool command to combine multiple apks to deploy to the device (this process is automatically combined within the tool based on the device connected to adb)

1. Prepare the environment

The java environment is required to use the bundletool tool. It is recommended to use the JRE8 environment. Please download and install it yourself, and configure the system environment variables.

2. Download the bundletool.jar package

Download address: https://github.com/google/bundletool/releases

3. Use cmd command to convert aab file to apks file

The command format is as follows:

java -jar <bundletool.jar的路径> build-apks --bundle=<.aab文件的路径>
--output=<输出.apks的路径> --ks=<打包使用的证书文件的路径> --ks-pass=pass:<证书密码> --ks-key-alias=<证书别名> --key-pass=pass:<证书别名密码,通常与证书密码一致>

For the convenience of self-test, I put the bundletool-all-1.8.2.jar downloaded earlier, the app-release.aab generated by packaging, and the certificate file my.jks (assuming the certificate alias is test and the password is 123456) into the same directory. Switch to the current directory on the command line, and use the following command to generate app-release.apks (if you do not put it in the unified directory, you need to enter the complete file path according to the above command format)

java -jar bundletool-all-1.8.2.jar build-apks --bundle=app-release.aab --output=myapp.apks --ks=my.keystore --ks-pass=pass:123456 --ks-key-alias=test --key-pass=pass:123456

Note: The generated apks file will be very large, but it will take up less space than the original apk format file when installed on the mobile phone (this is because only the resources needed by the current device are installed). In addition, you can add the --connected-device parameter to the command line to generate an apks file only for the currently connected device, reducing the size of the apks file

4, Use the cmd command to install the apks file to the phone

The command format is as follows:

java -jar <bundletool.jar的路径> install-apks --apks=<上一步中生成的.apks文件路径>

In addition: According to Google's requirements, applications uploaded in aab format must join the Google Signature Protection Program, and a signature certificate file needs to be submitted after joining.

Guess you like

Origin blog.csdn.net/Jackson_Wen/article/details/121291520