Android Play Storeへのデプロイ
If you are using Capacitor, you can additionally refer to the Capacitor documentation for Deploying to Google Play.
Generating a release build of an app
- Capacitor
- Cordova
To generate a release build for Android, build your web app and then run the following cli command:
npx cap copy && npx cap sync
This will copy all web assets and sync any plugin changes.
Next, open Android studio:
npx cap open android
To generate a release build for Android, run the following cli command:
$ ionic cordova build android --prod --release
This will generate a release build based on the settings in the config.xml
in the platforms/android/app/build/outputs/apk
directory of an app.
An Ionic app will have preset default values in this file but this can be changed to customize builds.
Signing an APK
- Capacitor
- Cordova
To create an AAB binary locally using Android Studio:
- Open the Build menu
- Choose Generate Signed Bundle / APK
- Follow the prompts to sign the AAB with your keystore file
For complete details, view the Android documentation.
Google Play Signing
If you haven't made the switch to Android app bundles yet, you will need to opt into Play App Signing in the Google Play Console to be able to publish them.
New Apps
First, create a new app in the Google Play Console. In order to enable app signing, you'll need to navigate to the new release screen, on one of the Production, Open testing, closed testing, or internal testing pages. Select the Create new release button as seen below (it doesn't matter which release type, since you don't have to actually go through with creating a new release right now):
Under the App integrity section, click the Change app signing key button:
Next, select the Export and upload a key from Java Keystore option. This is the only way in which you can retain the key and have Google Play use it for signing. If you're using Appflow to build Android apps in the cloud, this is also the required option so you can upload the keystore file to Appflow.
Follow the instructions on the screen to generate the Keystore and you can use the same Keystore file to sign your app in the Appflow dashboard as well. If you need any help generating the Keystore file, you can refer to our docs here. Once the generated zip file has been uploaded, you're all set! Build an AAB binary signed with the keystore file then upload it to Google Play.