How to run CTS tests in android(Eclair)?

匿名 (未验证) 提交于 2019-12-03 01:12:01

问题:

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

回答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.



回答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: http://www.cygwin.com

  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} com.android.cts.TestHost "$(cygpath -w "${CONFIG}")" "$@" ${DDCONFIG} 

Save startcts as Unix file. I use dos2unix.exe downloaded from http://waterlan.home.xs4all.nl/dos2unix.html 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"



回答3:

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



回答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 ./cts-tradefed 

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

in the cts-shell:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!