开发者

How to run Android's CTS on windows on an emulator

I downloaded CTS tool from 开发者_StackOverflow this source(Android 2.3 R3 CTS) and unzipped.

I have added SDK_ROOT in my environment variables and set path to android SDk directory.

I have set path to "path=c:\android-sdk-windows\platform-tools" for ADB.

I used

 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\CtsTestAnnotationsHostLib;
 c:\android-sdk-windows\tools\lib\ddmlib.jar"

to enter CTS shell.

But it gives error..

Exception in thread "main" java.lang.NoClassDefFoundError: com/android/ddmlib/An
droidDebugBridge$IDeviceChangeListener
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.android.cts.TestHost.<clinit>(TestHost.java:64)
Caused by: java.lang.ClassNotFoundException: com.android.ddmlib.AndroidDebugBrid
ge$IDeviceChangeListener
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 13 more

Could not find the main class: com.android.cts.TestHost. Program will exit.

I am not able to get to CTS Console screen..please do help..


I had the same issue by using cygwin

I found the solution on this blog

You just have to do the modification of those two line in the script startcts : 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}

Then I was able to have the CTS prompt

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜