. One Android device (MID, mobile, etc.)
. USB cable
. Android SDK (Linux) ; The SDK version should match to your device
http://dl.google.com/android/android-sdk_r18-linux.tgz
Android-sdk_r08-linux.tgz for SDK2.3
Linux. Android CTS and CTS media files {The CTS version should match to your device}
http://source.android.com/compatibility/downloads.html
. Environments> z4root (Root the Android device firstly if you need)
http://forum.xda-developers.com/attachment.php?attachmentid=446145&d=1290341328 [^]
> /etc/udev/rules.d/51-android.rules
> $(CTS_ROOT)/repository/host_config.xml
; Modify the item: <IntValue name="maxTestCount" value="200" /> to <IntValue name="maxTestCount" value="-1" />
> ENV virables
>> export SDK_ROOT=~/android-sdk-linux
>> export PATH=${SDK_ROOT}/platform-tools:${SDK_ROOT}/tools:$PATH
>> export CTS_ROOT=~/Downloads/android-cts
- Android device's preparations
This section is important as not following these instructions will lead to test timeouts/failures:
1. Your phone should be running a user build (Android 4.0 and later) from source.android.com
2. Please refer to this link on the Android developer site and set up your device accordingly.
3. Make sure that your device has been flashed with a user build (Android 4.0
and later) before you run CTS.
4. You need to ensure the Text To Speech files are installed on the device. You can check via Settings > Speech synthesis > Install voice data before running CTS tests. (Note that this assumes you have Android Market installed on the device, if not you will need to install the files manually via adb)
5. Make sure the device has a SD card plugged in and the card is empty. Warning: CTS may modify/erase data on the SD card plugged in to the device.
6. Do a factory data reset on the device (Settings > SD Card & phone storage >
Factory data reset). Warning: This will erase all user data from the phone.
7. Make sure no lock pattern is set on the device (Settings > Security > Screen Lock should be 'None').
8. Make sure the "USB Debugging" development option is checked (Settings >
Developer options > USB debugging).
9. Make sure Settings > Developer options > Stay Awake is checked
10. Make sure Settings > Developer options > Allow mock locations is checked
11. Make sure device is connected to a functioning Wi-Fi network (Settings > Wi-Fi)
12. Make sure the device is at the home screen at the start of CTS (Press the
home button).
13. While a device is running tests, it must not be used for any other tasks.
14. Do not press any keys on the device while CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures.
15. Set up accessibility tests:
1. adb install android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
2. On the device, enable Settings > Accessibility > Delegating Accessibility Service
16. Set up device administration tests:
1. adb install android-cts/repository/testcases/CtsDeviceAdmin.apk
2. On the device, enable Settings > Security > Device Administrators > android.deviceadmin.cts.CtsDeviceAdmin* settings
- Steps
. Connect your Android device to your Linux PC
. Check the debug connection
> lsusb ; You'll see
Bus 001 Device 006: ID 0bb4:0c01 High Tech Computer Corp. Dream / ADP1 / G1 Phone
> adb devices
List of devices attached
???????????? no permissions ; If this case, you need to restart adb sevice as root
> adb kill-server
> sudo $(SDK_ROOT)/platform-tools/adb start-server
> adb devices
List of devices attached
0123456789ABCDEF device
. setup your device (or emulator) to run the accessibility tests
> adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk97 KB/s (7867 bytes in 0.079s)
pkg: /data/local/tmp/CtsDelegatingAccessibilityService.apk
Success
> On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service
; Different Android SDK might has minor differences. More detailed information, please visit:
http://source.android.com/compatibility/cts-intro.html
. Launch the CTS / run test plan / check the test results
> android-cts/tools/startcts ; Lanch to CTS_HOST> ls --plan
List of plans (8 in total):
VM
Performance
Java
Signature
Android
RefApp
AppSecurity
CTS
> start --plan CTS ; Choose one of them to test, waiting for a long times ....
> ls -r ; Check the test results
The test results are placed in the file: $CTS_ROOT/repository/results/<start time>.zip
Inside the zip, the testResult.xml file contains the actual results -- open this file in any web browser (Firefox 3.x recommended) to view the test results.
Refer to Android official document: Android-CTS-manual
$ cat /etc/udev/rules.d/51-android.rules
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="kkkk"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="kkkk"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="kkkk"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="kkkk"
# /etc/udev/rules.d/51-android.rules
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="kkkk"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="kkkk"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="kkkk"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="kkkk"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="kkkk"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="kkkk"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="kkkk"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="kkkk"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="kkkk"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="kkkk"