This tutorial explains how to generate a key for your Android application.
People regularly ask me how to generate a key for your Android application so I thought I’d give a quick run through of the process.
*NOTE: This is a key for building apps for the Android Market/Google Play. For testing, you can use the debug key you already have.
**This is written for Mac users and I don’t currently have access to a PC but I believe the same commands in the terminal apply there too. If anyone could confirm that would be great!
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 really need to, write it down. If 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”, so you’d enter your city name. (Sydney, London, San Francisco, etc.)
Step 8 ) You’ll be asked for your “state or province”, so you’d enter the name of your state. (New South Wales, California, Florida, etc.)
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 for the market using your newly generated keystore
I hope you will find this useful and it might make the process a little less daunting the first time around.
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.