How to Generate Signed Android App Bundle

Since Google Play has warned the developers

Ref link: https://support.google.com/googleplay/android-developer/answer/9303479

Signing a Android App Bundle file becomes a must.

Following are the steps to build a such bundle.

First, you have to generate a .jks or .keystore file with Google Play signing.

You can either do this with CMD/Terminal or just use the Android Studio’s Generate Signed Bundle or APK feature.

To generate a JKS file from existing keystore, or a keystore from CMD/Shell, you can check my other blog posts: How to Generate A Java Keystore for Android Apps, and/or Facebook API: Key Hash for Android App, or To Generate JKS Keystore From Existing Keystore & Use it in Android Apps

To generate the keystore or JKS file with Android Studio, you can go to Build -> Generate Signed Bundle or APK -> choose Android App Bundle, click Next.

On the Generate Signed Bundle or APK window, click Create New…

Choose a keystore’s path, enter and confirm key store password and key password; as for the Certificate part, enter information you think is necessary, you can leave some of the fields blank.

Once done, click OK. You will find the .keystore or .jks file in the key store path shown in the screenshot.

Back to the Generate Signed Bundle or APK window, there will be a fields ask you to export .pem file.

To generate a .pem file, open and run your CMD/Terminal in the folder that has your keystores/jks files, or use cd [path] to direct to that folder, and type down following command lines:

"[put Java keytool.exe path here]" -export -rfc -keystore "[path to your keystore/jks file]" -alias upload -file upload_certificate.pem

The system will ask you to enter key store password (not key password), once succeed, the system will show a message like: Certificate stored in file <certificate.pem> then you can find the .pem file in the folder you ran your command lines.

For the first time generating Android App Bundle, Android Studio checked the Export encrypted key…box by default, clicke on the folder icon, browse your folder that contains the PEM file, and click Next:

You can choose to generate debug or release bundle, then click Finish, Android Studio will start buiding Android app bundle and .pepk file.

You can find the .pepk in the folder with keystores, and the android app bundle file in the destination folder you assigned, in this case, the path is C:\App\release

And that’s it.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.