如何在模拟器上运行Android的CTS
我从此来源下载了CTS工具(Android 2.3 R3 CTS )并解压。
我已在环境变量中添加了 SDK_ROOT 并将路径设置为 android SDK 目录。
我已将 ADB 的路径设置为 "path=c:\android-sdk-windows\platform-tools"。
我使用
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"
进入CTS shell。
但它给出了错误..
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
找不到主类:com.android.cts.TestHost
。程序将退出。
我无法进入 CTS 控制台屏幕
..请帮忙..
I downloaded CTS tool from 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..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 cygwin 遇到了同样的问题
,我在 此博客
您只需修改脚本 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}然后我就能够得到 CTS 提示
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