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 ?
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 ?
将 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 超时问题,因为某些 adb 命令需要超过 20 秒才能在我的 MotoA953 设备上返回(其中之一是am instrument -w -e bundle true android.tests.devicesetup/android.tests.getinfo.DeviceInfoInstrument
)。