开发者

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 Cont开发者_如何学Pythonacts ? Thank you


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

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜