Android CTS 在模拟器上显示 ShellCommandUnresponsiveException

发布于 2024-10-03 18:19:51 字数 166 浏览 5 评论 0原文

我正在 Android 2.2 上运行的模拟器上运行 Android CTS Android 测试计划。

但大多数测试用例都显示超时,并且错误显示 com.android.ddmlib.ShellCommandUnresponsiveException。

有什么办法可以解决这个问题吗?

I am running Android CTS Android Test Plan on an emulator running on Android 2.2.

But most of the test cases are showing timeout and the error shows com.android.ddmlib.ShellCommandUnresponsiveException.

Is there any way to solve this issue ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

感受沵的脚步 2024-10-10 18:19:51

将 shell 命令超时设置为 5 分钟(而不是 5 秒:-))

diff --git a/tools/host/src/com/android/cts/TestDevice.java b/tools/host/src/com/android/cts/TestDevice.java
index 65ff969..b8578bc 100644
--- a/tools/host/src/com/android/cts/TestDevice.java
+++ b/tools/host/src/com/android/cts/TestDevice.java
@@ -18,6 +18,7 @@ package com.android.cts;

 import com.android.ddmlib.Client;
 import com.android.ddmlib.ClientData;
+import com.android.ddmlib.DdmPreferences;
 import com.android.ddmlib.IDevice;
 import com.android.ddmlib.IShellOutputReceiver;
 import com.android.ddmlib.MultiLineReceiver;
@@ -143,6 +144,7 @@ public class TestDevice implements DeviceObserver {
         mDeviceInfo = new DeviceParameterCollector();
         mPackageActionTimer = new PackageActionTimer();
         mObjectSync = new ObjectSync();
+        DdmPreferences.setTimeOut(300000);
     }

Set shell command time out to 5 minutes (instead of 5 seconds:-))

diff --git a/tools/host/src/com/android/cts/TestDevice.java b/tools/host/src/com/android/cts/TestDevice.java
index 65ff969..b8578bc 100644
--- a/tools/host/src/com/android/cts/TestDevice.java
+++ b/tools/host/src/com/android/cts/TestDevice.java
@@ -18,6 +18,7 @@ package com.android.cts;

 import com.android.ddmlib.Client;
 import com.android.ddmlib.ClientData;
+import com.android.ddmlib.DdmPreferences;
 import com.android.ddmlib.IDevice;
 import com.android.ddmlib.IShellOutputReceiver;
 import com.android.ddmlib.MultiLineReceiver;
@@ -143,6 +144,7 @@ public class TestDevice implements DeviceObserver {
         mDeviceInfo = new DeviceParameterCollector();
         mPackageActionTimer = new PackageActionTimer();
         mObjectSync = new ObjectSync();
+        DdmPreferences.setTimeOut(300000);
     }
杯别 2024-10-10 18:19:51

对于像我这样的新手,请注意:

  1. 下载 android 源代码
  2. ,应用补丁,并使用命令进行构建: make cts
  3. 复制新构建的文件 cts.jar 来替换库存文件。

这修复了 CTS 超时问题,因为某些 adb 命令需要 20 秒以上才能在我的 MotoA953 设备上返回(其中之一是 am Instrument -w -e bundle true android.tests.devicesetup/android.tests.getinfo.DeviceInfoInstrument< /代码>)。

A bit more notes for newbies like me:

  1. download android source
  2. apply the patch, and build with command: make cts
  3. copy the newly built file cts.jar to replace the stock one.

This fix CTS timeout problem because some adb commands needs more than 20 seconds to return on my MotoA953 device (one of these is am instrument -w -e bundle true android.tests.devicesetup/android.tests.getinfo.DeviceInfoInstrument).

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