11 янв. 2012 г.

Signing Android apps

After reading android developer official guide Signing Your Applications I was a little bit confused what exactly I have to do for signing app.
Basically process of signing apps includes five steps:
  1. Create your keystore;
  2. Prepare app for signing (removing logs, increment version etc);
  3. Export app as unsigned apk;
  4. Sign apk;
  5. Run zipalign tool.
There are three ways:
  1. Do it manually from command line;
  2. Use ANT script;
  3. Do it with the help of wizard in Eclipse.
Eclipse wizard will do 3-5 steps automatically.
So the fastest way to sign apk is to:
  1. Create your keystore;
  2. Prepare app for signing (removing logs, increment version etc);
  3. Export signed apk with Eclipse.
Create keystore
$ keytool -genkey -v -keystore APPNAME.key -alias APPNAME -keyalg RSA -keysize 2048 -validity 10000
Check if JAVA_HOME is set or find keytool executable file in bin folder of Java.


Show keystore info
$ keytool -list -v -keystore afit.key

Export signed apk with Eclipse
Right click on project > Android Tools > Export Signed Application Package... > and follow wizards instructions.

Комментариев нет:

Отправить комментарий