Robotium Test No source apk--need to re-sign apk

Source: Internet
Author: User

Robotium is based on the instrumentation framework, and its test scripts are written in the same process as the program being tested, so this requires the test program to have the same signature as the program being tested, otherwise it will not be able to communicate.
In the case of APK only, the program can be signed with the method of "sign and sign again". And no sign of the APK is not loaded into the phone.

Do you want to ask why the apk I packaged in my test program can be installed without signing?

That's because when you use eclipse to generate the APK, Eclipse automatically signs you with the signature tool in the local SDK, so Eclipse's packaged apk can be loaded directly into the phone.

So if you want to communicate with the program under test, that is to do the testing, two ways:

1. Check which signature is used for the program under test, and you can also sign your own test script with the signature of the program under test, but this is not easy to do.

The test procedure if there is no source code, the signature estimate is also not possible, that is confidential documents, rarely out of the way,

For example, you want to test the app, but you can't get the app signed, so you can only use the second method.

2, the test program is also signed with your testing script the same signature, that is also used in the Local SDK signature tool to re-check.

Here (http://jingyan.baidu.com/album/bad08e1ee438e109c851213d.html?picindex=2) introduces two methods,

The first is the use of Debug.keystore, the second is the use of Re-sign.jar. Either way, you first configure environment variables, android_home, Java_home, and so on.

Here you will normally need to configure the Android environment needs to configure, after running the signature command, if prompted, can't find the path, and so on, you go with another, because I can not remember exactly which of the several.

Method One, the use of Debug.keystore, I do not do more introduction, you can refer to http://www.51testing.com/html/92/115892-223023.html, anyway, I did not succeed, do not know what the problem, I wish you good luck!

Method Two, the use of Re-sign.jar, this special convenience, a success, just re-sign.jar bad download, in the Internet to find a lot, have not found, finally found in a test of the group files, Emperor not pay attention, finally fix!

Now the Re-sign.jar download link http://files.cnblogs.com/files/zh-ya-jing/re-sign.zip share to everyone!

If the top has not solved your problem, you may be like me, the test is the mobile phone system, the entire mobile phone system preinstalled a number of apps, using the method described above two of the test program signed into the same signature as the testing script, which is obviously unrealistic,

So you can only use method one, the test script signed into the mobile phone system app signature, you can only find the mobile phone system version of the development project group, requesting the mobile app signature. After signing, you can control the mobile app by loading the test script onto your phone!

Robotium Test No source apk--need to re-sign apk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.