Android CTS

来源:互联网 发布:软件开发报价表 编辑:程序博客网 时间:2024/05/13 01:04

RunningGuide

2011107

14:51

 

DUTPreparation

  1. Selecta good DUT(Device Under Test). Make sure the DUT pass the adb-rebootstress test (at least 800 times).

  1. Makesure power adapter is connected to the DUT.

  1. Checkif the Wifi/BT and Camera works on the DUT. Without them some casescan't pass.

  2. Ensure'adb' is in your system path.

Example:

exportPATH=$PATH:/home/myuser/android-sdk-linux_x86/platform-tools

DUTSetup

  1. Cleanthe data partition on DUT and then Reboot. (adb shell; cd /data/; rm-r *; sync)

  1. Settings->Developer options: enable the following items:

USBDebugging

Stayawake

Allowmock locations

  1. Settings->Security-> Unknown sources: disable it.

  1. AccessibilityDelegating: adb installandroid-cts/repository/testcases/CtsDelegatingAccessibilityService.apk

  1. Admin:adb install android-cts/repository/testcases/CtsDeviceAdmin.apk andactivate it via Settings -> Security -> Device administrators-> > Select device administrators

  1. Settings->Accessibility-> SERVICES-> Delegating Accessibility Service

  1. Settings->Date & time: set the correct date and time,aswell as the timezone.

  1. Settings->Language & input: Select English as the default.

  1. Wifi:connect an AP which has access to external website. Make sure thatAP isthe only ONE remembered AP.

  1. SDCard: make sure an SD card is plugged and with at least 200MB freespace.

  1. Goto HOME screen andNO touchduring the test.

  2. Makesure no lock pattern is set on the device (Settings > Security >Screen lock should be 'None').



HostPreparation

  1. Ubuntu10.04 or 11.04 on an x86 PC is needed for running CTS Host.

  1. InstallJava6 SDK:

$sudo add-apt-repository "debhttp://archive.canonical.com/lucid partner"
$ sudo add-apt-repository "deb-src
http://archive.canonical.com/ubuntulucid partner"
$ sudo apt-get update
$ sudo apt-getinstall sun-java6-jdk

Pastedfrom <http://source.android.com/source/initializing.html>

  1. Unzipandroid-cts-3.2.1_r5-x86-arm.zip

  1. Makesure Host PC is also connected with power adapter andwon'tgo to sleep mode.

  1. Rebootthe Host before starting cts.Itis also important to keep the Host environment clean.

  1. 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

  1. Edit/etc/security/limits.conf and add the following values at the bottomto avoid "Toomany open files issue":

*- nofile 51200

 

RunningCTS on Host

  1. $sudosu

  2. $<android-cts>/tools/cts-tradefed

  1. cts_host>runcts --plan CTS

 



Notes:running CTS under root account, so that it can avoid the adb nopermission issue.

 

Capturingthe log

  1. 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

  1. Theresult locates at<android-cts>/repository/results/2012.<Mon>.<Day>_<Hour>.<Min>.<Sec>/

  1. 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


原创粉丝点击