Ionic: awesome framework to create hybrid applications. I assume that you already created your app and tested. Let’s directly proceed with the steps to publish ionic 4 android app to google playstore.
Table of Contents
Step 1: Building ionic 4 app.
ionic cordova build --release android
This just creates unsigned apk file and the same available in “YOUR_PROJECT_NAME\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk”
Step 2: Generating keystore file
keytool -genkey -v -keystore yourappname-key.keystore -alias yourappnamealiasname -keyalg RSA -keysize 2048 -validity 10000
Generating the keystore which is needed to make the unsigned apk to signed apk, this keytool tool is aleady available if jdk is installed.
Step 3: Converting Unsigned apk to signed apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore yourappname-key.keystore app-release-unsigned.apk yourappnamealiasname
It converts your unsigned apk to signed apk.
Step 4: zipping for publising
zipalign -v 4 path_of_unsigned_apk\yourapp-unsigned.apk path_of_signed_apk\yourapp.apk
zipalign can be found in windows similar to this path: Users\AppData\Local\Android\Sdk\build-tools\28.0.3