ionic 3 build android apk code example
Example 1: generate apk ionic 1
$ ionic cordova build --release android
Example 2: ionic publish
// generate .keystore file
keytool -genkey -v -keystore app.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
// sign the apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore app.keystore app-release-unsigned.apk alias_name
// zip the apk
zipalign -v 4 app-release-unsigned.apk ReleaseSigned.apk
Example 3: build ionic 3 project apk
ionic cordova platform add android
npm i -g cordova-res
ionic cordova resources android --force
ionic cordova build android --release
ionic cordova build android --prod
ionic cordova run android