How to run CTS tests in android(Eclair)?

In order to release a device to the market, You need to run the Compatibility Test Suite given by android...I need to know how to download and run it..

Asked by: Michelle424 | Posted: 24-01-2022

Answer 1

As XC said in a comment, as of 2.0, the CTS is freely available.

For it to be runnable, you have to build the tests. In your top level android directory, do all the normal build set-up steps and then

make cts

Then in the out/host/linux-x86/cts/android-cts/tools sub directory, you will find the startcts bash script. I expect the location might depend on what platform you are building on. Modify it to point out your SDK and then run the script. It is relatively self explanatory.

Answered by: Edgar509 | Posted: 25-02-2022

Answer 2

Thanks for all the guides and links above that helps me to setup the CTS successfully.

I using - Android CTS v2.3_r8

I summarize the steps here for those who wish to get CTS up on Windows.

  1. Install cygwin here:

  2. I placed android-cts in my cygwin folder e.g. C:\cygwin\home\Username\. You may set up accordingly if you have placed it elsewhere.

  3. Create new Environment Variables to point to SDK_ROOT and CTS_ROOT directories

    1. Go to Control panel->System -> Advanced tab
    2. Click on Environment variables
    3. Click on New to add CTS_ROOTS to system variables and add the path of android-cts to its value
    4. Do the same for SDK_ROOT and add the path of andriod-sdk to its value
  4. Go to android-cts\tools and modify 2 lines in the startcts script file as follows [With help from How to run Android's CTS on windows on an emulator but some slight modification that works for me

    JARS="$(cygpath -w -p ${CTS_LIB}:${DDM_LIB}:${JUNIT_LIB}:${HOSTTEST_LIB})"
    java ${JAVA_OPTS} -cp ${JARS} "$(cygpath -w "${CONFIG}")" "$@" ${DDCONFIG}

Save startcts as Unix file. I use dos2unix.exe downloaded from to convert it to Unix file.

Then, to run CTS

  1. Attach android device to PC

  2. (a) Go to cmd prompt, type adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk

  3. (b) On the device, enable all the android.deviceadmin.cts.* device administrators under Settings > Location & security > Select device administrators

  4. Run cygwin and go to android-cts/tools

  5. Execute Android CTS by ./startcts

For how to run the tests in CTS, I refer again to section Working with CTS in the link given the earlier comment by cezio "using-androids-compatibility-test-suite"

Answered by: William590 | Posted: 25-02-2022

Answer 3

There is a quite good documentation on Android's source website. Also, some time ago I've wrote small crash course on CTS.

Answered by: Lenny214 | Posted: 25-02-2022

Answer 4

As of ICS (4.0), cts has had a bit of a makeover. Now it's called cts-tradefed.

The Google-provided documentation is available here.

For a simple way to get up to speed on using cts-tradefed from your AOSP root directory and a connected device with a matching AOSP build:

make cts
cd out/host/$OSDIR/cts/android-cts/tools

Here, $OSDIR is either linux-x86, darwin-x86

in the cts-shell:

list packages
list plans
run cts --plan CTS
run cts --package android.webkit

If it's not obvious, you can also use one of the plans or packages listed from list packages or list plans. Hopefully this will be helpful to someone else. It would've been quite helpful for me to find it earlier.

Answered by: Oliver255 | Posted: 25-02-2022

Similar questions

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Android