Thursday, December 1, 2011

Run CTS under Windows

Create simple script cts.bat, set correct path to sdk and cts packages
set SDK_ROOT=C:\android-sdk-windows\
java -Xmx512M -cp c:\android-cts\tools\cts.jar;c:\android-cts\tools\hosttestlib.jar;c:\android-cts\tools\junit.jar;c:\android-cts\tools\ddmlib-prebuilt.jar C:\android-cts\repository\host_config.xml

once you run the script you should see cts greeting: cts_host>
start executing test: start --plan CTS -p android.os.cts.BuildVersionTest

Update for CTS 2.3 R12 and beyond:

CTS media files should be copied to device only if you are going to execute CTS media stress test.

script cts.bat (set correct path to sdk and cts packages)
set SDK_ROOT=C:\android-sdk-windows\
java -Xmx512M -cp c:\android-cts\tools\cts-tradefed.jar;c:\android-cts\tools\hosttestlib.jar;c:\android-cts\tools\ddmlib-prebuilt.jar;c:\android-cts\tools\tradefed-prebuilt.jar -DCTS_ROOT=c:\

cts greeting: cts-tf>
start executing test: run cts -p