Android adb “Unable to open sync connection!”

前端 未结 18 2175
小蘑菇
小蘑菇 2020-12-07 09:21

I can run and debug my Android app on my phone just fine, most of the time. Then, seemingly randomly, when I try to run or debug my app from Eclipse, the Console in Eclipse

相关标签:
18条回答
  • 2020-12-07 09:37

    I have been experiencing this problem very often (I mean like every second time I launched Debug). I was using a rather long USB cable. I switched to the original HTC USB cable which is short and the problem was gone!

    0 讨论(0)
  • 2020-12-07 09:40

    When this happens on the Kindle Fire I just power it off and back on again.

    0 讨论(0)
  • 2020-12-07 09:42

    I have been having the same problem when I have the phone connected through my keyboard's USB hub. IT went away when I connected straight to the computer's USB port.

    0 讨论(0)
  • 2020-12-07 09:42

    I experienced this problem when my USB cable was connected to PC via keyboard USB :O. When I connected it to PC directly my problem solved.

    I hope this works.

    Enjoy!

    0 讨论(0)
  • 2020-12-07 09:49

    The solution is likely to run on your android phone (on local terminal or ssh terminal): $ stop adbd; start adb

    I don't like overkill solutions like rebooting hte phone... and this is usually not needed under Linux. I experienced the same problem when connecting over Wifi, so USB is maybe not responsible at all. Reading the answer from user655489, I got the idea to run lsof, and then lsof | grep adbd | wc -l => I think I had over many sockets open with all FD from 0 to 1023 in use... how suspicious.

    I ran killall adbd, then restarted adbd per How can I connect to Android with ADB over TCP? And the problem was gone.

    The cause is that, at least when debugging and having to kill my non-working apps, that several of the sockets never get closed.

    0 讨论(0)
  • 2020-12-07 09:52

    I see this problem regularly in both attached devices (Phone or Tablet) and even the emulators. I noticed that the problem often follows periods of inactivity (after a lunch break for example). It may be that the Operating System on the development machine is trying to conserve resources and adb just isn't all that JIT friendly. On windows I have to close the IDE and open Task Manager and force stop (kill) adb, then relaunch Eclipse. This always works for me...

    • I noticed if I set a higher priority in task manager for adb, this problem is greatly reduced--although it can still happen.
    0 讨论(0)
提交回复
热议问题