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:
Log in as root: adb root
Remount: adb remount
adb pull /system/app/X.apk (Replace X with the name of the application)
Resign X.apk so that it has the same certificate signing as the test project
adb pull /data/system/packages.xml
Open packages.xml and remove:
..... 7. Push packages.xml back to device: adb push packages.xml /data/system
Restart your device
Push the resigned X.apk back to the device: adb push X.apk /system/app
Follow the details section
精彩评论