Thursday, January 3, 2013

Create Signed Android Application using Eclipse

Signing Android Application

Before I tell you about creating the keystore/key in Android using Eclipse IDE, you should know that it is important to sign the Android Application as the Android system does not allow installing unsigned application on the device and also on the emulator.
Android application can be built in following two modes:
    -  debug mode: use while you are developing and testing the application
    -  release mode: use when you want to publish the application on Google Play or to provide the app to the End User.

Creating Debug Keystore/Key

It is really simple. When you run the Application from Eclipse, the debug mode is enabled by default. The ADT signs the application automatically with the debug certificate and you can run the .apk file on emulator and also on a device. The ADT integrated with Eclipse has access to Keytool utility which auto creates the debug keystore and key. By default the debug keystore/key has the following names and passwords:
    -  key.store=“debug.keystore”
    -  key.alias=“androiddebugkey”
    -  key.store.password=“android”
    -  key.alias.password=“android”
Please note that you cannot release the Android Application signed in debug mode. Also, you can find the debug keystore in the .android folder (in my case C:\Users\Soofia faruq\.android\debug.keystore).

Creating Release Keystore/Key

Creating key using Eclipse IDE is really simple. Right click on your project ApiDemos à Android Tools à Export Signed Application Package as shown in picture below:
Export_Signed_Application_Package
A project selection dialog appears. Here browse the project you want to export:
Select_Project_to_Export
Next, Keystore selection dialog appears. Here you can browse the existing keystore and enter its password or in our case right now, can create a new keystore. Enter the location of the keystore and mention its name. As shown below in picture: C:\keystore\ is the location and market is the name of my keystore. Enter Password and Confirm Password for the keystore which should be strong.
Keystore_Selection
Next in a new dialog as shown below you will be prompted for some more information regarding key. Enter data in all the required fields.
Key_Creation
Specify the destination folder and name of the final build as shown below and hit Finish.
Destination_and_Key/Certification_Check
Now you have the keystore created in the defined folder and also the build. If you are building the signed application using Ant script as mentioned in the post Create Signed Build of Android Application using Ant Script then also you can use the same keystore.

2 comments:

Thankyou! This helped me loads!

I never knew you had to do this!

I have already exported a signed .apk. But I face a huge problem with facebook login authentication.I guess the problem is on hask key.
I have spent a week trying to figure out this problem, with no success..
Is there anything else I should do after the exportation of the app for the hask key?

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More