Skip to content

Instantly share code, notes, and snippets.

@vijaydeepak-tt
Created February 27, 2018 04:20
Show Gist options
  • Save vijaydeepak-tt/2ed681e9e84039a0a7ca464ce9b6cc52 to your computer and use it in GitHub Desktop.
Save vijaydeepak-tt/2ed681e9e84039a0a7ca464ce9b6cc52 to your computer and use it in GitHub Desktop.
A commands to generate the APK for the Ionic or React native projects.
#Generate APK:
run "ionic cordova build --release android".
It generates the unsigned apk file.
#Sign The Apk:
Check Keytool in cmd, if working no problem, otherwise install jdk and add the jdk bin path to the path Environment Variable.(C:\Program Files\Java\jdk1.7.0_79\bin)
Then run "keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000"
Note: Give any password as your wish.
After running the above cmd it will generate "my-release-key.keystore" file inside the application folder.
Next To sign the unsigned APK, run the "jarsigner" tool which is also included in the JDK.
Move the Unsign build apk to the main folder.
After run the cmd "jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore .apk alias_name".
Enter the password same as given before as in step 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment