各位,最经使用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 而这在模拟器里是没有问题的。有人给解释下。
解决方案 »
- 在android下写一个cpp文件播放mp3
- android刚开始创建时,有选择默认图标或什么的。程序写完后,再怎么改?不想修改res下的文件,太麻烦。
- BaseAdapter中的GetCount方法频繁调用,请高手看看
- android surfaceview使slidingdrawer布局显示不完整?
- Gridview如何保存当前浏览状态?
- 如何设置button在屏幕的最左下脚和又下脚显示
- 如何改变CheckBoxPreference组件中title和summary字体的大小
- 在html5中使用navigator.getUserMedia打开相机,要怎样进行关闭?
- 疯狂Android讲义的QQ群
- 这种json 用gson 怎么解析啊
- 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权限