Skip to content

Instantly share code, notes, and snippets.

@shithee
Created August 29, 2021 14:51
Show Gist options
  • Save shithee/7e820f6c977ce959f593ef13013355c1 to your computer and use it in GitHub Desktop.
Save shithee/7e820f6c977ce959f593ef13013355c1 to your computer and use it in GitHub Desktop.
The Terminal codes required to build the production apk in the ionic capacitor project.
## Build the ionic app -- for production
ionic build
## Add android platform
ionic capacitor add android
## Sync the project for android
ionic capacitor sync
## To generate the Keytool
keytool -genkey -alias alias_name -keystore keystore_name.pfx -storetype PKCS12 -keyalg RSA -validity 10000 -keysize 2048
##To generate unsigned APK
cd android &&
./gradlew assembleRelease &&
cd app/build/outputs/apk/release
##Sign the apk with jarsigner
jarsigner -keystore path_to_keystore.pfx -storepass keystore_password app-release-unsigned.apk alias_name
## Get the Release Apk
sudo zipalign 4 app-release-unsigned.apk app-release.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment