4

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 ?

4

2 回答 2

5

将 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);
     }
于 2010-12-16T14:56:43.400 回答
0

对于像我这样的新手还有一点注意事项:

  1. 下载安卓源
  2. 应用补丁,并使用命令构建:make cts
  3. 复制新建的文件cts.jar以替换库存文件。

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

于 2011-09-16T09:45:28.860 回答