Build Android APK easily with Cordova CLI

4

Index

Stats

8,980 visits, 19,018 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 25 Nov, 2017. Last updated 19 Feb, 2019

Part 3: signign an unsigned release APK.

after you'have fine tested your debug apk on your android devices, and you want to build a signed release apk (that is required by google playstore for example), then back at the command prompt window, go into yourprojectname folder by typing cd yourprojectname then type cordova build android --release then press enter and wait that cordova build the unsigned release APK.

now it's time to sign your unsigned apk's by creating a keystore to signing them!

type keytool -genkey -v -keystore yourprojectname -alias yourprojectname -keyalg RSA -keysize 2048 -validity 10000

NB for those longs codelines you can copy paste changing only "yourprojectname" word

complete the procedure by typing your personal data and carefully choose and save the password/passphrase you are going to use on this step!! this is crucial if you want a tomorrow to update your app

well, now type this codeline then press enter

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore yourprojectname c:/users/yourusername/yourprojectname/platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk yourprojectname

and now the last step to build the apk just signed!

go here (see the path on the image below) then Hold Shift + Right Click the folder with the SDK version, and click "the powershell voice"

on powershell opened at desired path..

just type this codeline to build your signed APK

./zipalign.exe -v 4 c:/users/yourusername/yourprojectname/platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk yourprojectnameARMV7-signed.apk

NB Your signed APK are saved on this same directory! to build also x86 architecture apk just repeat the "jarsigner" and "zipalign" procedure changing armv7 with x86 wherever you find it written on the above codelines

  • 0 Comments

Want to leave a comment? Login or Register an account!