我正在运行Android CTS Android测试计划,该计划运行在Android 2.2上的模拟器上。
但是大多数测试用例都显示超时,并且错误显示为com.android.ddmlib.ShellCommandUnresponsiveException。
有没有办法解决这个问题?
我正在运行Android CTS Android测试计划,该计划运行在Android 2.2上的模拟器上。
但是大多数测试用例都显示超时,并且错误显示为com.android.ddmlib.ShellCommandUnresponsiveException。
有没有办法解决这个问题?
将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);
}
对于像我这样的新手,还有一些注意事项:
make cts
cts.jar
复制以替换原始文件。这个修复 CTS 超时问题,因为我的 MotoA953 设备上有一些 adb 命令需要超过 20 秒才能返回(其中之一是 am instrument -w -e bundle true android.tests.devicesetup/android.tests.getinfo.DeviceInfoInstrument
)。