5
How to re-sign a Android .apk file for testing

How to re sign a android apk file for app testing

Embed Size (px)

Citation preview

Page 1: How to re sign a android apk file for app testing

How to re-sign a Android .apk file for

testing

Page 2: How to re sign a android apk file for app testing

A signature is needed to identify the author of the Android application. A signature mostly contains information like:

First nameLast nameName of the organizationCityStateCountry Code

For more information please have a look at the Android SDK developer guide http://developer.android.com/guide/publishing/app-signing.html

Page 3: How to re sign a android apk file for app testing

If you want to test an apk file e.g. with Robotium the android app apk and your test project apk file MUST have the same signature!

There are two possible cases how to sign the apk file. The first one is really simple, if you build the Android app you want to test on your own within eclipse you don’t need to resign the apk file. The signatures should be the same.

The second case is more complex.If you get the apk file you have to test e.g. from your developers, from jenkins or from the market you have to resign the app.

Page 4: How to re sign a android apk file for app testing

Do the following steps to resign it with your keystore:

1. Rename the apk file into a zip file, e.g. yourapp_name.apk = Name.zip

2. Unpack/ Unzip the zip file

3. Delete the META-INF folder

4. Repack/ Rezip the folder again to a zip file

5. Rename the zip file again to an apk file

6. Open a terminal window / Command prompt and enter (the jarsigner tool is

located in the bin folder of your installed java sdk

Page 5: How to re sign a android apk file for app testing

jarsigner -keystore ~/.android/debug.keystore -storepass android –keypass android urAppName.apk androiddebugkey

You’re Done!! Now you can should be able to test against an apk file!