I have seen a ridiculous number of useless tutorials on how to create an Android keystore/certificate to be used for sigining Android apps that I decided I needed to write one that is actually useful. First of all, the example provided by Phonegap Build and others doesn’t work with more recent versions of the java keytool and I guess they gave up on updating their docs (probably because of the impossible task of maintaining what Oracle is updating). My guess is that you already have found that out and that is why you are here checking out this tutorial. Apple has a nice GUI interface to use for generating iOS certs (the down side is you have to have a MAC) and now you can use a GUI tool on your PC as well to generate your Android keystore! You are about to find out how!
The first thing we are going to do is install a free application called Keystore Explorer from here: http://keystore-explorer.sourceforge.net/ Once you have done that you are ready to open it up and create a new keystore choosing the following:
We are trying to create a Java Keystore (JKS).
Now we need to generate a keypair:
We want a 2,048 RSA key (which should be the default)
It’s important to note that we need to have a key for Google Play that has an expiration date AFTER October 22, 2033 (yeah who knows why) so just choose 25 years from now.
We do have to add our name and a little information about ourselves here:
Here is what that might look like:
You should be able to use the default alias
Okay you did it! Now you just have to save your keystore and get ready to use it in your build environment (for me that is PhoneGap Build). When you save the keystore using Keystore Explorer be sure to save it with the .keystore extension (PhoneGap won’t accept the keystore otherwise).
I hope this helps make the process easier for you. If you are like me you spend most of your time programming and you just don’t commit the signing stuff to memory (mostly because it’s mildly annoying). Hopefully this tutorial will make it a little less annoying for you and allow you to get back to focusing on your code.