This tutorial explains how to generate a key (keystore) to sign your Android application.
I know a lot of you are probably surprised I’m writing about Android, however lately I’ve seen a number of people requesting information and I really wanted to make it simple.
I will state right now that not being very experienced with Android, (I have no device currently I can build for,) I do not know whether it is correct to call this a “key” or a “keystore” – so I’m sticking with “key” for now
*NOTE: This is a key for building apps for the Android Market. For testing, use the debug key you already have.
**This is written for Mac users only.
Step 1 ) Open the terminal.
Step 2 ) Type in keytool -genkey -v -keystore yourappname.keystore -alias appnamealias -keyalg RSA -keysize 2048 -validity 10000
Changing the parts I have bolded into your own information.
Then hit enter.
Step 3 ) You will be asked for a password; don’t use anything you will forget and if you need to, write it down. It you lose the password you wont be able to update your application in the future.
Step 4 ) You will asked to re-enter you password, do so, then hit enter again.
Step 5 ) You’ll be asked for your first and last names, key those in, hit enter again.
Step 6 ) You’ll be asked for the name of your “organizational unit” – I would use Techority for mine – you would likely use your studio name or, if you don’t have any alternatives, your own full name. (I guess this would really be more suited to entering a division within a company, like “marketing” or “sales”, but I wouldn’t remember that.) Enter again.
Step 6 ) You’re asked for the name your organization, I would again use Techority and you would do as you’ve done above. (Studio name or full name.)
Step 7 ) You’ll be asked for your “city of locality”, I live in the city of Sydney currently, so that was my answer.
Step 8 ) You’ll be asked for your “state or province”, I’m in New South Wales, so I typed that in.
Step 9 ) More location questions, you will need to key in the two letter code for your country. The United States is of course “US”, Australia for me was “AU”.
Step 10 ) Finally, you will be asked to confirm all is correct and then enter your password once more, which will be the same as the one you entered and reentered in steps 3 and 4.
Step 11 ) The .keystore file has been created! You can find it by clicking on the magnifying glass in the top right and doing a quick search for .keystore – move it to a safe folder you have created and be sure to back that up immediately.
And that’s it!
You can now build your Android app using your newly generated key
I hope this is of use to you all, I know many of us do not develop for Android (yet?) but it’s information I felt was important to get out there.
I’d like to say thanks to Joe of Fire Maple Games as he was the one to originally teach me how to do this.