Original URL: http://blog.csdn.net/shi_xin/article/details/42262675
1.CTS Downloads
Open the following URL,
Http://source.android.com/compatibility/downloads.html
Take android5.0 as an example, after entering the page, click Android 5.0 R1 compatibility Test Suite (CTS)-arm for download;
Of course, if you do not open the above URL, is the network does not FQ, after the network FQ, you can open the Web page.
My configuration: Modify the browser's proxy, the automatic configuration proxy URL is set to: Http://10.5.2.98/proxy.pac
2.JDK Configuration
android5.0 requires a PC JDK environment of jdk1.7 and switches the JDK to 1.7
Android different version of the different versions of the JDK, check online, corresponding to modify the JDK version of the PC;
3. Link phone
Link the phone, turn on USB debugging, confirm that the computer has been linked to the mobile phone
The terminal runs ADB devices to confirm that the phone is linked.
4. Run CTS
Unzip download file Android 5.0 R1 compatibility Test Suite (CTS)-ARM,
Enter android-cts/tools/to execute the cts-tradefed script file.
5. Set up your phone
1. Language set to 中文版;
2. When testing the CTS, the device cannot hibernate, enter the security option, and set the screen lock to None
May not be the same, in short, to remove the lock screen;
3. Turn on the GPS;
4. Connect to a Fqwifi network;
5. Turn on USB debugging, tick stay awake,allow mock locations;
6. After installing CTSDEVICEADMIN.APK, tick the first two of the device administrators;
Wherein,ctsdeviceadmin.apk is located in the downloaded CTS unpacking directory;
Under the android-cts/repository/testcases.
=================================================================================
To this, the basic configuration is completed, if the developer, generally do not need to run all the case, just run their own case on OK.
If you run all the case, after the 4 step operation, enter the terminal on the popup
Run CTS--plan CTS.
For developers to run a specific case:
A. Run Cts-p < package name >. Parameter-p means that the test is a package. For example, to test all cases under the Android.view.cts package, execute the command:
Run Cts-p android.view.cts
B. Test a class: Run Cts-c < class name >. The class name needs to be preceded by the name of the package, and the parameter-C means that the test is a class. For example, to test the audiotracktesT class under the android.media.cts package, execute the command:
Run Cts-c android.media.cts.AudioTrackTest
C. Test Case:run Cts-c < class name >-M <case name > In a class. The case name refers to the method name under the class, and the parameter-m means that the test is a method. In the example above, to test the method Testplaystreamdatain the Audiotracktes class under the android.media.cts package, execute the command:
Run Cts-c android.media.cts.audiotracktest-m testplaystreamdata
D. If you need to cycle through a case, add a loop
run cts–c android.media.cts.audiotracktest–m testplaystreamdata--loop--min-loop-time 60000 60000 indicates the time interval of each cycle, in MS;
If
run cts–c android.media.cts.audiotracktest–m testplaystreamdata--loop
The default is 10-minute loop to do it once.
2. View Results
After the test is completed, the test results are generated in the following directory. is a folder that is named after the date and time the test started.
android-cts/repository/results/
After opening the appropriate folder, for example android-cts/repository/results/2014.12.30_10.44.20, there are testresult.xml files,
Open this file as a Web page and you'll see the results. This is the result of testing a single case.
| |
|
|
|
|
Show Device Information
| Test Summary |
| CTS version |
5.0_r1 |
| Test Timeout |
600000 ms |
| Host Info |
UBTPC (Linux-3.2.0-23-generic) |
| Plan Name |
NA |
| Start time |
Monday February or February 10:35:33 CST 2014 |
| End time |
Monday February or February 10:41:12 CST 2014 |
| Tests Passed |
1 |
| Tests Failed |
0 |
| Tests Timed out |
0 |
| Tests not Executed |
0 |
Test Summary by Package |
| Test | Package
Passed |
Failed |
Timed | out Not
Executed | Total
Tests |
| Android.media |
1 |
0 |
0 |
0 |
1 |
Detailed Test Report
| Compatibility Test Package:android.media abi:armeabi-v7a |
| Test |
Result |
Details |
| Android.media.cts.AudioTrackTest |
| --Testplaystreamdata |
Pass |
|
If you execute a case, you can see whether the result is successful on the terminal that pops up after the 4 steps above.
"Turn" Android CTS test methods and procedures