cts的运行是建立在有android sdk,否则需要下载,
1,设置cts环境,需要下载cts sdk, 在这个site http://source.android.com/compatibility/downloads.html 可以下到。使用android的源码也可以编译,但是推荐下载最新的cts;
2,Configuring CTS
Option A - On Linux (Ubuntu or MAC)
This Option must be used for CTS Submissions.
1. To configure CTS, extract the contents of the zip file
2. Edit the android-cts/tools/startcts script - modify the variable SDK_ROOT to match your environment.
Example:
SDK_ROOT=/home/myuser/android-sdk-linux_x86-1.6_pre_r1
This should point to the top-level directory where you unzipped the Android SDK to.
Option B - On Windows
This Option is only available for developers to debug CTS failures. Test teams DO NOT USE WINDOWS TO RUN CTS. No additional support will be given outside of this section. Google designed CTS to run only in Linux.
1. Save and unzip this batch script to android-cts/tools/ folder, and set SDK_ROOT=path of the SDK.
2. Right click "My Computer", select Properties->Advanced tab->Environment variables
3. Create new User Variable "CTS_ROOT", set Value to path of CTS root folder (i.e. D:\Android\CTS\android-cts)
4. Create new User Variable: ANDROID_ROOT, set Value to path of SDK root folder (i.e. D:\Android\android-sdk-windows-1.6_r1)
5. Edit System Variable: Path, append the path of SDK root folder/tools (i.e. D:\Android\android-sdk-windows\tools\)
6. Also append the path of C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\ntutils; before the path pf SDK root folder/tools.
3,Execute CTS
1. Start cts (from Linux terminal) bash startcts, or (from Windows command prompt) startcts
2. Run a test (suite) package (i.e. android.net) from test plan (Android) by entering the test command "start --plan Android -p android.net"
3. Run a test case "start --plan Android -t android.widget.cts.GridViewTest#testPressKey"
4. For a complete list of CTS commands, please refer to the User Manual.
5. You can refer to android-cts\repository\testcases\*.xml