This is a very tricky part and initially i was also ran in to strange problems . Before uploading to android market you must do the following steps.

  • Create a Certificate
  • Signing your application apk
  • Finally Zip align the signed apk

First the application you created should be converted to apk format. For this if you are using Eclipse

Right click the project –> Android Tools –>Export Unassigned Application Package.

Then choose the path and Save.

Create a Certificate

For this specify keytool path in Environment Variable as

C:Program Files (x86)Javajdk1.6.0_14bin

The Open CommandPrompt and type

>keytool -genkey -v -keystore myCertificate.keystore -alias m
yKey -keyalg RSA -keysize 2048 -validity 20000

myCertificate.keystore is the name of the Certificate
Validity is given in Days

Now a prompt will ask for

  • Password
  • First and lastname
  • Name of Organization unit
  • Name of Organization
  • City
  • State
  • Country

After entering these fields we get our Certificate

Signing your application

>jarsigner -verbose -keystore myCertificate.keystore D:Listv
iew.apk myKey

Listview is the name of the apk i have exported. Now it will ask for the password and then it will replace the apk with the signed one.
Also you can check your app is signed or not by

$ jarsigner -verify Listview.apk

if Signed the Jarsigner prints “jar verified”

Zipalign the  signed apk

The zipalign tool is provided with the Android SDK, inside the tools/ directory. To align your signed .apk, execute:
So sett up Environment variable as done above

>zipalign -v 4 D:Listview.apk D:SignedListview.apk

Now your apk is ready for upload….



  1. Jan December 14, 2011 at 5:25 pm

    Thanks this helped me

  2. BitKFu August 12, 2012 at 6:18 pm

    Thanks a lot. You described it really simple. Only one thing: I had to use JDK 1.6 (using 1.7) is not possible due to incompatible binaries.

  3. Pingback: Android APK Code Signing « All about nothing

  4. dan August 27, 2013 at 6:53 am

    best tutorial! One thing i would add to make it easier….copy a cmd and your apk to a folder and work from there so you dont have to write out paths…also ONLY WORKS WITH JAVA 6

  5. neena Sajjit November 1, 2013 at 9:43 am

    Thanks, this blog was really helpful. Just wanted to add that cmd prompt has to be run in administrator mode for generating the certificate in windows. Running cmd prompt in windows is done by right clicking on start ->Run as administrator

  6. Merdan November 5, 2013 at 12:41 pm

    Thanx it really helped me.


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.