RunningGuide
2011年10月7日
14:51
DUTPreparation
-
Selecta good DUT(Device Under Test). Make sure the DUT pass the adb-rebootstress test (at least 800 times).
-
Makesure power adapter is connected to the DUT.
-
Checkif the Wifi/BT and Camera works on the DUT. Without them some casescan't pass.
-
Ensure'adb' is in your system path.
Example:
exportPATH=$PATH:/home/myuser/android-sdk-linux_x86/platform-tools
DUTSetup
-
Cleanthe data partition on DUT and then Reboot. (adb shell; cd /data/; rm-r *; sync)
-
Settings->Developer options: enable the following items:
USBDebugging
Stayawake
Allowmock locations
-
Settings->Security-> Unknown sources: disable it.
-
AccessibilityDelegating: adb installandroid-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
-
Admin:adb install android-cts/repository/testcases/CtsDeviceAdmin.apk andactivate it via Settings -> Security -> Device administrators-> > Select device administrators
-
Settings->Accessibility-> SERVICES-> Delegating Accessibility Service
-
Settings->Date & time: set the correct date and time, aswell as the timezone.
-
Settings->Language & input: Select English as the default.
-
Wifi:connect an AP which has access to external website. Make sure thatAP isthe only ONE remembered AP.
-
SDCard: make sure an SD card is plugged and with at least 200MB freespace.
-
Goto HOME screen andNO touchduring the test.
-
Makesure no lock pattern is set on the device (Settings > Security >Screen lock should be 'None').
HostPreparation
-
Ubuntu10.04 or 11.04 on an x86 PC is needed for running CTS Host.
-
InstallJava6 SDK:
$sudo add-apt-repository "deb http://archive.canonical.com/lucid partner"
$ sudo add-apt-repository "deb-srchttp://archive.canonical.com/ubuntulucid partner"
$ sudo apt-get update
$ sudo apt-getinstall sun-java6-jdk
Pastedfrom <http://source.android.com/source/initializing.html>
-
Unzipandroid-cts-3.2.1_r5-x86-arm.zip
-
Makesure Host PC is also connected with power adapter and won'tgo to sleep mode.
-
Rebootthe Host before starting cts. Itis also important to keep the Host environment clean.
-
Removethe previous results in <android-cts>/repository/results/ andthe log files in <android-cts>/repository/. This may cause"Toomany open files"issue in CTS Host
-
Edit/etc/security/limits.conf and add the following values at the bottomto avoid "Toomany open files issue":
*- nofile 51200
RunningCTS on Host
-
$sudosu
-
$<android-cts>/tools/cts-tradefed
-
cts_host>runcts --plan CTS
Notes:running CTS under root account, so that it can avoid the adb nopermission issue.
Capturingthe log
-
Bothhost and device logs locate at the dir:/android-cts/repository/logs/device_logcat_8750823928717142044.ziphost_log_63793616747035791.zip You can use the below command line tocapture the log.
$sudosu
$adbkill-server
$while [ 1 ]; do adb logcat -v threadtime | tee -a cts.log; done
Notes:running adb under root account, so that it can avoid the adb nopermission issue.
Checkthe result
-
Theresult locates at<android-cts>/repository/results/2012.<Mon>.<Day>_<Hour>.<Min>.<Sec>/
-
Theresult file will be updated when the CTS is running. You can checkit with firefox in the meantime. But don'tuse vim or other tool that will lock the file when opening it, as ifCTS can't update the result file, the result will be unexpected.
run cts --plan CTS // full test
run cts -p android.accessibilityservice // test plan
run cts -c android.accessibilityservice.cts.xxxxx // test class
run cts -c android.accessibilityservice.cts.xxxxx -m testview //test method