I want to show you a smart and simple way how you can sign and verify your release .apk with the Ionic CLI and without zipalign and/or apksigner step by step.
Step 1: Add the android platform to your Ionic/Cordova project with
ionic platform add android
Step 2: Create your Keystore file (JavaJDK is required) and save it in your resources folder (or create a separate folder):
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
If you lose your key, you can’t update your android application anymore in the PlayStore.
Step 3: Create a file named release-signing.properties in the platforms/android folder with the following content
target=android-25 android.library.reference.1=CordovaLib storePassword=MyPassword keyPassword=MyPassword keyAlias=mycompanyname storeFile=../../resources/android-release-key.jks
But I suggest to keep your password secret and avoid writing them in a clear text file.
Step 4: Run
ionic build android --release
If anything works correct the CLI generates now a signed and verified apk named
android-release.apk in your