1

我在使用monkeyrunner 时遇到了麻烦,只要模拟器启动,waitForConnection 就会死掉。我检查了 为什么 MonkeyRunner.waitForConnection() 错误“Adb 拒绝 adb 端口转发命令:无法绑定套接字”

我试过adb kill-server adb start-serversudo。但他们没有帮助。

我正在使用 sdk 版本 20.0.1。Mac OSX 10.7.5

chengyang:~$adb devices 附加的设备列表 emulator-5554 设备

chengyang:~$monkeyrunner
Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) 
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_35
>>> from com.android.monkeyrunner import MonkeyRunner
>>> MonkeyRunner.waitForConnection()                 
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Adb rejected adb port forwarding command: cannot bind socket
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice]com.android.ddmlib.AdbCommandRejectedException: cannot bind socket
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.ddmlib.AdbHelper.createForward(AdbHelper.java:545)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.ddmlib.Device.createForward(Device.java:481)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.AdbChimpDevice.createManager(AdbChimpDevice.java:126)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.AdbChimpDevice.<init>(AdbChimpDevice.java:72)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.AdbBackend.waitForConnection(AdbBackend.java:107)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.ChimpChat.waitForConnection(ChimpChat.java:92)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:75)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.lang.reflect.Method.invoke(Method.java:597)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyObject.__call__(PyObject.java:381)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyObject.__call__(PyObject.java:385)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.pycode._pyx2.f$0(<stdin>:1)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.pycode._pyx2.call_function(<stdin>)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyTableCode.call(PyTableCode.java:165)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyCode.call(PyCode.java:18)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.Py.runCode(Py.java:1197)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.Py.exec(Py.java:1241)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:147)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:89)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:70)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:46)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveConsole.push(InteractiveConsole.java:110)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:90)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:60)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.monkeyrunner.ScriptRunner.console(ScriptRunner.java:193)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:73)
121022 23:14:48.340:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:189)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
    at com.android.chimpchat.adb.AdbChimpDevice.<init>(AdbChimpDevice.java:74)
    at com.android.chimpchat.adb.AdbBackend.waitForConnection(AdbBackend.java:107)
    at com.android.chimpchat.ChimpChat.waitForConnection(ChimpChat.java:92)
    at com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.NullPointerException: java.lang.NullPointerException
>>> 
4

0 回答 0