1

I have developed a phonegap app and created an APK but I need to add the signing key.

I've read that it's done with Eclipse but I don't use eclipse to create the apps.

Is there any way to get the signing key without having to use Eclipse?

Note: I'm using windows 7 OS

Satch3000
  • 47,356
  • 86
  • 216
  • 346

3 Answers3

3

If you have the source code of your project you can build it without Eclipse, signing an unsigned apk can be also achieved using ant

Here is a quick tutorial on how to build signed APK without Eclipse.

Type in to CMD

cd your/project/folder/
android update project -p .

Add to project.properties the following settings:

key.store=path/to/export/key
key.alias=alias_name
key.store.password=store_password
key.alias.password=alias_password

Type in to CMD

cd your/project/folder/
ant relese

The output APK will be found in the bin folder

Note: that this requires android SDK installed.

if you get the following error:

'android' is not recognized as an internal or external command
'ant' is not recognized as an internal or external command

You should add your android-sdk/tools and android-sdk/platform-tools to system path, here is a tutorial on how to do it:

http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx

Kirill Kulakov
  • 10,035
  • 9
  • 50
  • 67
  • I seem to be doing something wrong here ... I've created a folder and added my .apk file and then typed: android update myproject.apk -p ... This seems to be wrong ... is it asking for the index.html name there? I'm a bit confused as it's the first time I'm attempting this :) – Satch3000 Aug 18 '12 at 11:45
  • As mentioned this method will work on RAW SOURCE CODE ONLY not a compiled APK. If you want to just sign an unsigned apk, there should be a way to do so via the ANT command, google somthing like "android ant sign apk" – Kirill Kulakov Aug 18 '12 at 13:06
  • Thanks for this tip. I feel like the Cordova /PhoneGap getting started docs aren't as clear as they should be on code signing. – thinkbigthinksmall Apr 06 '14 at 13:34
2

You need a signapk.jar that is generated when you build AOSP. And then use the below command Search for signapk.jar on the internet you will be able to download it.

java -jar signapk.jar certificate.pem key.pk8 your-app.apk  your-signed-app.apk  
nandeesh
  • 24,740
  • 6
  • 69
  • 79
1

Try this Below Link for Signing to apk file with out eclipse and with eclipse tutorial

http://www.coderzheaven.com/2011/04/01/android-signing-apk/

Dinesh
  • 6,500
  • 10
  • 42
  • 77