Wednesday, March 19, 2014

Generate Android Key using Command Line

We need Android Key while developing an Android application. Sometimes we need to set in our editor in-order to generate an android build. So, how we can generate an Android Key?

There are many ways to generate Android Key like, by using Eclipse tool and by using command line. Here we will discuss how we can generate an Android key using command line.

System Requirements: Install latest JDK in your system.

  • Open command line by "Run as Administrator" option.
  • Go to bin folder of JDK installation, for me it's "C:\Program Files\Java\jdk1.6.0_35\bin", for you it may be different path.
  • Then type the following command:
keytool -genkey -v -keystore expensetracker.keystore -alias expensetracker -keyalg RSA -keysize 2048 -validity 10000

Here, expensetracker.keystore is the key store name and expensetracker in blue colored is the alias name.
Below is the screen shot:


Then you have to enter keystore password in the command prompt as shown below:


You can provide any key with minimum 6 length and just a note whenever you will type your password you can't see it typing in command prompt. Then it will ask other information like first name, last name, Organization Unit.., you ca provide any value as per your wish as shown below:


Then it will ask to confirm your information, type "yes" and press "Enter". Then it will ask for entering Key password, you can keep key password same as keystore or you can give a different password it's your choice then you will see a success message in the command line "Storing expensetracker.keystore" as below:



So, your key is generated and it's present in the bin folder. Go to the bin folder of the JDK and search there with file name "expensetracker.keystore". If you have provided a different keystore name then you have to search using that name. Here you will get the keystore as shown below:



We got the keystore file and can use anywhere for Android App development.

1 comment:

  1. Water Hack Burns 2lb of Fat OVERNIGHT

    More than 160000 men and women are using a easy and secret "liquid hack" to burn 1-2 lbs each night while they sleep.

    It's easy and works all the time.

    Here's how you can do it yourself:

    1) Go grab a drinking glass and fill it with water half glass

    2) Then follow this amazing hack

    and you'll be 1-2 lbs skinnier the next day!

    ReplyDelete

Followers