各位,最经使用monkeyrunner做自动测试,发现在模拟器里边能够响应的脚本命令,在真机里失败
如: >>> device.press('KEYCODE_BACK',MonkeyDevice.DOWN_AND_UP)
111128 17:02:51.308:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Error se
nding press event: KEYCODE_BACK DOWN_AND_UP
111128 17:02:51.308:S [main] [com.android.chimpchat.adb.AdbChimpDevice]java.net.
SocketException: Software caused connection abort: socket write error 而这在模拟器里是没有问题的。有人给解释下。
如: >>> device.press('KEYCODE_BACK',MonkeyDevice.DOWN_AND_UP)
111128 17:02:51.308:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Error se
nding press event: KEYCODE_BACK DOWN_AND_UP
111128 17:02:51.308:S [main] [com.android.chimpchat.adb.AdbChimpDevice]java.net.
SocketException: Software caused connection abort: socket write error 而这在模拟器里是没有问题的。有人给解释下。
解决方案 »
- 如何指定安卓虚拟机新建avd的位置?
- 保存图片
- 急,无法建立数据库,怎么回事?
- SQLite 用什么加密方式比较好?
- Socket通信 用手机3g网络连接不到服务器,内网连接没问题
- 请教:Android中的Activity和Service是否属于同一个进程
- Androidannotation 的问题
- 关于android 中path菜单的问题求大神解决
- webview报错nativeOnDraw failed; clearing to background color.
- anroid Animation 一个很值得讨论的问题
- 100分求:应用到底安装到哪里去了?
- Android新手问一下:tools:context 和 xmlns:tools 可有可无?有什么意义?谢谢!
adk platform-tools rev9
5B0E01A008
04:49:31 E/hierarchyviewer: Unable to get view server protocol version from devi
ce 015EF45B0E01A008
04:49:33 E/hierarchyviewer: Unable to debug device 015EF45B0E01A008
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
java.lang.RuntimeException: Could not connect to the view server
at com.android.chimpchat.hierarchyviewer.HierarchyViewer.setupViewServer
(HierarchyViewer.java:56)
at com.android.chimpchat.hierarchyviewer.HierarchyViewer.<init>(Hierarch
yViewer.java:42)
at com.android.chimpchat.adb.AdbChimpDevice.getHierarchyViewer(AdbChimpD
evice.java:96)
at com.android.monkeyrunner.easy.EasyMonkeyDevice.<init>(EasyMonkeyDevic
e.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.python.core.PyReflectedConstructor.make(PyReflectedConstructor.ja
va:67)
at org.python.core.PyJavaType$1.new_impl(PyJavaType.java:475)
at org.python.core.PyType.invoke_new_(PyType.java:432)
at org.python.core.PyType.type___call__(PyType.java:1374)
at org.python.core.PyType.__call__(PyType.java:1365)
at org.python.core.PyObject.__call__(PyObject.java:397)
at org.python.core.PyObject.__call__(PyObject.java:401)
at org.python.pycode._pyx13.f$0(<stdin>:1)
at org.python.pycode._pyx13.call_function(<stdin>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1197)
at org.python.core.Py.exec(Py.java:1241)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:147)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter
.java:89)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:70)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:46)
at org.python.util.InteractiveConsole.push(InteractiveConsole.java:110)
at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:9
0)
at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:6
0)
at com.android.monkeyrunner.ScriptRunner.console(ScriptRunner.java:193)
at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.
java:73)
at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter
.java:189)java.lang.RuntimeException: java.lang.RuntimeException: Could not connect to the
view server
from com.android.hierarchyviewerlib.device import ViewNode需要root权限