Chindji
Chindji

Reputation: 61

Using Robotium when only having APK

I found Robotium for about one week ago, its a really nice tool. I an new in android testing and Java programming. Please I will like to know if there is any existing solution or example to make use of Robotium for pre-installed application like Android Phone Dialer and Contacts ? Thank you

Upvotes: 3

Views: 1206

Answers (2)

hareesh J
hareesh J

Reputation: 530

From the Robotium Guide for using the apk with signed and unsigned

https://code.google.com/p/robotium/wiki/RobotiumForAPKFiles

Upvotes: 2

Sazid
Sazid

Reputation: 2827

From the Robotium guide:

With Robotium it is possible to run test cases on applications that are pre-installed. For this to work you need to resign the pre-installed application with the same certificate signing of your test project. That requires you to have a rooted phone as you must have access to the /system/app folder on the device.

Observe that some pre-installed applications do not function properly when re-installed with a new certificate signing. An example is the contacts application (Contacts.apk) that does not show up when re-signed.

Details There are some steps that you need to follow to make it work:

  1. Log in as root: adb root

  2. Remount: adb remount

  3. adb pull /system/app/X.apk (Replace X with the name of the application)

  4. Resign X.apk so that it has the same certificate signing as the test project

  5. adb pull /data/system/packages.xml

  6. Open packages.xml and remove:

..... 7. Push packages.xml back to device: adb push packages.xml /data/system

  1. Restart your device

  2. Push the resigned X.apk back to the device: adb push X.apk /system/app

  3. Follow the details section

Upvotes: 1

Related Questions