Building with Cordova - PART 02 - Build an Android App

  • 18 favourites



11,399 visits, 45,251 views



This tutorial hasn't been translated.


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.

Step 10 - Sign our Android application

Now the keystore file will be located in the same folder as our compiled application. We still need to sign the APK file using that keystore file. If you look at the android build folder, you'll find that the keytool utility created the file there.

Like I stated before, this file doesn't need to be generated every time you build your game, just once. We will reuse it to sign the APK every time we build with Cordova. Just make sure you remember the password to your key file. Write it down somewhere if needed.

10.1 - Use the jarsigner tool to sign our APK file. Type in the following command and press Enter:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore MyFirstKeyStore.keystore android-armv7-release-unsigned.apk MyFirstKS

Don't mind the confusing parameters used. The only important ones are the three parameters after -keystore:

a) "MyFirstKeyStore.keystore" - the file name containing our key (created in the previous step).

b) "android-armv7-release-unsigned.apk" - The file name of our compiled game.

c) " MyFirstKS" - the alias name for the key we informed in the previous step.

Save that command somewhere so we don't need to type all that again.

That's it! Your game is ready to be uploaded to your Android device for testing.

Important Note

Just to remember what I stated before, most of these steps are only needed once per project. After that, every time you make changes to your Construct 2 project, you only need to do the following actions and ignore the rest:

1) Export your Construct 2 project for Cordova in the "www" folder (explained in the Part 01 tutorial).

2) Follow the step "Step 8 - Build the APK!".

3) Follow the step "Step 10 - Sign our Android application"

Stay tuned for the next tutorial on the series and thank you for reading!


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