This tutorial explains how to generate a key (keystore) to sign your Android application.
I’ll be posting the next installment of Platino for Newbies shortly, but I wanted to take a brief detour to explain step by step how to make a keystore and build your Android app.
*This post is for Vijay, who has been working very hard on his first app, which he is about to ship. Congrats, Vijay!
Step 1 ) Open “Terminal” if you are on a Mac, or “Command Prompt” if you are on Windows.
Step 2 ) Type in:
keytool -genkey -v -keystore yourappname.keystore -alias appnamealias -keyalg RSA -keysize 2048 -validity 10000
BUT change “appname” to the name of your app, and “appnamealias” to the alias. For me, I often use the same for both, so for a game called “Insomnia” I would do:
keytool -genkey -v -keystore Insomnia.keystore -alias Insomnia -keyalg RSA -keysize 2048 -validity 10000
Step 3 ) You need to pick a password; just make sure it is something you are not going to forget, even write it down if you need to, because you will need it to update the application in the future. (If you are building for the store, if it’s just for your own device it doesn’t matter.)
Step 4 ) You will be asked to re-enter the password.
Step 5 ) Next you’ll just need to put in your first and last name, nothing fancy. “Peach Pellen”.
Step 6 ) You’ll be asked for the name of your “organizational unit” – I’d put “CTO”, “Developer” or I might use the name of my department, such as “Engineering”. It’s not really important and will never come up again, so just do what makes sense to you.
Step 6 ) You’re asked for the name your organization, I would use “Learn Platino” or “Black Gate Games”, and you would do either the name of your company/studio, or your own full name if you don’t have one.
Step 7 ) Next, You’ll be asked for your “city of locality”, I live in the city of Sunnyvale currently, so that is what I would put in.
Step 8 ) Now you need to put in your state, I always put in “California”, and I don’t abbreviate it to “CA”. That’s force of habit more than anything but as the country is deliberately shortened I feel like it’s good practice to use the full name of your state.
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 is “AU”, the United Kingdom is “UK”, etc.
Step 10 ) Finally, you’ll be prompted to confirm all is correct and then enter your password once more, which will be the same as the one you used in steps 3 and 4.
Step 11 ) Your .keystore file has been created! You can locate it by searching your system 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
*Of course, you can also use tools like Eclipse which have built in keystore generators, but you will still need to enter the same information so it doesn’t save time in the end – this is a skill worth learning.
Thanks for reading and please keep an eye out for my upcoming tutorials!
*Being included in the “insomnia series” category because it’s 4:18am, and I don’t know what else to call that 😉