Why does MonkeyRunner.waitForConnection() error “Adb rejected adb port forwarding command: cannot bind socket”

痞子三分冷 提交于 2019-12-08 04:37:46

问题


When I try to get a device with MonkeyRunner I get this message:

newdevice = MonkeyRunner.waitForConnection() 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: cannot bind socket 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.AdbCommandRejectedException: cannot bind socket

I'm running monkeyrunner.bat from the commandline in windows Xp with JDK 1.6.0_26, Python 2.7.2, and Android SDK 11. adb devices shows my USB device.


回答1:


I also had come across this problem but killing and restarting the adb server din't solve the issue. I have solved it with below procedure

  1. open command prompt and run below command netstat -ano This lists all PID and port numbers. Make a note of PID listening on port 12345
  2. Go to task manager->Processes tab and from View->Select Coloumns Tick the PID field. Now kill the process with PID noted in previous step.

Now the MonkeyRunner proceeds further.

Note:

12345 port is identified from AdbChimpDevice.java in chimpchat.jar located in

..\android-sdk-windows\tools\lib\chimpchat.jar



来源:https://stackoverflow.com/questions/6950223/why-does-monkeyrunner-waitforconnection-error-adb-rejected-adb-port-forwardin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!