C:\Desktop\<sketchname>\android> keytool -genkey -v -keystore <sktechname>-release-key.keystore -alias <your name or anything> -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:
Is CN=name , OU=name, O=name, L=blah, ST=PA, C=US correct?
[no]: yes
Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of 10,000 days
for: CN=name, OU=name, O=name, L=blah, ST=PA, C=US
Enter key password for <your alias>
(RETURN if same as keystore password):
Re-enter new password:
C:\Desktop\<appname>\android> ant release
BUILD SUCCESSFUL
Total time: 12 seconds
-----------------------------------------C:\Desktop\<sketchname>\android> jarsigner -verbose -keystore <appname>-release-key.keystore c:\Desktop\<sketchname>\android\<appname>-unsigned.apk <your alias>
Enter Passphrase for keystore:
adding: META-INF/MANIFEST.MF
adding: META-INF/ALIAS.SF
signing: assets/ComicSansMS-25.vlw
signing: assets/CurlzMT-150.vlw
signing: assets/SegoePrint-60.vlw
signing: res/drawable/icon.png
signing: res/layout/main.xml
signing: AndroidManifest.xml
signing: resources.arsc
signing: res/drawable-hdpi/icon.png
C:\Desktop\<sketchname>\android> jarsigner -verify c:\Desktop\<sketchname>\android\<appname>-unsigned.apk
C:\Desktop\<appname>\android>zipalign -v 4 c:\Desktop\<appname>\android\<appname>-unsigned.apk <new appname>.apk
Verifying alignment of <appname>.apk (4)...
50 META-INF/MANIFEST.MF (OK - compressed)
973 META-INF/ALIAS.SF (OK - compressed)
1958 META-INF/ALIAS.RSA (OK - compressed)
3094 assets/ComicSansMS-25.vlw (OK - compressed)
23456 assets/CurlzMT-150.vlw (OK - compressed)
205025 assets/SegoePrint-60.vlw (OK - compressed)
7002884 res/drawable/icon.png (OK)
7005452 res/layout/main.xml (OK - compressed)
7005745 AndroidManifest.xml (OK - compressed)
7006548 resources.arsc (OK)
7007504 res/drawable-hdpi/icon.png (OK)
7011152 classes.dex (OK - compressed)
Verification succesful
I've been having a go at this signing process, following ckamath's neat walk through above (many thanks) and I'm pretty much there. Stepping through this process on a mac I will say pay particular attention to your paths (especially the step 8 zipalign -v 4 etc) This had me really stumped but I then realised I needed to code the path to zipalign in the SDK tools dir (android-sdk-mac_x86/tools/zipalign etc)
Anyhow, at the final hurdle, it appears I've got something wrong. I put the final apk up online to test, navigated to it via my phone web browser, downloaded it - all fine but then the damn thing won't install! I haven't the foggiest why. Phone is a HTC desire, unrooted. Is that why? Can I only download and run apps from the market?
Cheers!
ps. Forgot to say that I have the 'Unknown sources' option checked under Applications in settings. Hmmmm