Android adb “Unable to open sync connection!”

前端 未结 18 2288
小蘑菇
小蘑菇 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: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.

提交回复
热议问题