user3143901
user3143901

Reputation: 243

Any way to sign an apk file without using eclipse

I have an app which I want to sign and publish. I did not develop the app using eclipse. I have very little idea about programming. I have searched a lot of forums but could not find a way to do it. Can anyone explain the procedure to do it without using eclipse?

Upvotes: 1

Views: 76

Answers (2)

Pedro Lobito
Pedro Lobito

Reputation: 98971

1 - You haven't done so, you'll need to create a new key, open the command line and type:

keytool -genkey -noprompt \
 -alias      eclipse \
 -dname "CN=first and last name" \
 -keystore "c:\path\keyname.key" \
 -storepass password \
 -keypass password \
 -keyalg RSA \
 -keysize 2048 \
 -validity 10000

2 - Now you must sign the APK:

JAVA_HOME/bin/jarsigner 
 -verbose
 -keystore c:\path\keyname.key
 -storepass password
 -keypass password
 -signedjar DEV_HOME/bin/AndroidTest.signed.apk DEV_HOME/bin/AndroidTest.unsigned.apk AndroidTestKey

3 - Last step is to zipalign:

ANDROID_HOME/tools/zipalign 
-v 
-f 4  DEV_HOME/bin/AndroidTest.signed.apk DEV_HOME/bin/AndroidTest.apk

NOTES:
DEV_HOME is the location of you project
ANDROID_HOME is the Android SDK location
JAVA_HOME is the Java location

Upvotes: 1

Marcin Orlowski
Marcin Orlowski

Reputation: 75645

Signing process is documented here: https://developer.android.com/tools/publishing/app-signing.html

Upvotes: 0

Related Questions