如何在模拟器上运行Android的CTS

发布于 2024-11-17 07:11:47 字数 2107 浏览 1 评论 0原文

我从此来源下载了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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老旧海报 2024-11-24 07:11:47

我使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文