Building with Cordova - PART 02 - Build an Android App

2

Index

Stats

15,832 visits, 54,047 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 4 Oct, 2015. Last updated 19 Feb, 2019

Step 9 - Generating a keystore to sign our file

To use the APK file generated on the previous step with an Android emulator, we don't need to do anything else. But when we're ready to test the game on a real device, as a security measure, Android requires our file to be authenticated (signed) which means we'll need an extra step so we're able to test it on real devices.

We are going to generate a key that will be reused every time we need to build the project again. I won't go into details explaining what a keystore is and we definitely don't need to know much more of the subject to be able to build our game. We just need an authentication key that will be stored somewhere and we'll use that key to sign our app using command-line tools. I will explain how to do it.

9.1 - First, use the keytool command line tool to generate a new keystore. Save that keystore file to somewhere safe. We'll reuse that same file constantly. To make the tutorial simple, we will create the key in the same folder as the APK files.

Type in the following command:

"keytool -genkey -v -keystore MyFirstKeystore.keystore -alias MyFirstKS -keyalg RSA -keysize 2048 -validity 10000"

Then we'll be prompted to answer a few questions like name, organization, etc. and finally a password with six digits or more.

  • 0 Comments

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