FIXED: Can't connect to adb over wifi

江枫思渺然 提交于 2019-12-09 03:32:22

问题


It turns out that adbd Insecure was, in fact, the problem. When I disabled it (by running the app and unchecking Enable insecure adbd, I was able to connect just fine over wifi.

Also, for those who are interested, once this was working then netstat -n did show the connection, i.e.:

$ netstat -n 
Proto Recv-Q Send-Q Local Address          Foreign Address        State
tcp       0      0 0.0.0.0:5555               0.0.0.0:*              LISTEN
tcp       0      0 **192.168.0.169:5555**     192.168.0.50:51178     ESTABLISHED
tcp6      0      0 ::ffff:127.0.0.1:47514 :::*                       LISTEN

Barry


I am unable to get adb to connect over Wifi (it works fine over USB).

I've read through the various posts here and elsewhere and haven't found an answer that works for me.

I've tried connecting from my laptop to two different devices (Samsung S4, Nexus 7 2013 (wifi) It fails to connect in both cases, with the same error message, albeit with the IP address of the specific device, e.g.:

unable to connect to 192.168.0.125:5555

Both devices have been rooted using towelroot, SuperSU and "adbd Insecure". I am able to ping 192.168.0.125 from my laptop and I've turned off my laptop's virus protection and firewall.

I followed the standard steps:

  • adb kill-server
  • adb usb
  • adb devices
  • adb tcpip 5555
  • adb connect 192.168.0.125

I read that "netstat -n" should show a new socket present and listening on port 5555 (Can't connect to Android via ADB over wifi - Do I need root access?) but in my case that doesn't happen -- it only shows a localhost connection at the default port of 5037.

  root@deb:/ # netstat -n
  Proto Recv-Q Send-Q Local Address          Foreign Address        State
  tcp       0      0 127.0.0.1:5037         0.0.0.0:*              LISTEN

Output of "getprop | grep adb" is:

  $ adb shell
  root@deb:/ # getprop | grep adb
  getprop | grep adb
  [init.svc.adbd]: [running]
  [persist.radio.adb_log_on]: [0]
  [persist.sys.usb.config]: [mtp,adb]
  [ro.adb.secure]: [1]
  [service.adb.tcp.port]: [5555]
  [sys.usb.config]: [mtp,adb]
  [sys.usb.state]: [mtp,adb]
  root@deb:/ #

It appears that the system received and processed adb's "tcp 5555" command, but for some reason isn't able to use the information.

Since this is happening on both devices I'm guessing that the problem is:

  1. On my laptop or
  2. Something common to both devices (e.g., "adbd Insecure" installed) or
  3. Pilot error.

Questions:

  1. Shouldn't "netstat -n" show a socket listening at 192.168.0.125:5555?
  2. Is it possibly a problem related to the use of "adbd Insecure"???

Any/all help appreciated.

Thanks, Barry


回答1:


This answer has been given by Barry Holroyd:

It turns out that adbd Insecure was, in fact, the problem. When I disabled it (by running the app and unchecking Enable insecure adbd, I was able to connect just fine over wifi.

Also, for those who are interested, once this was working then netstat -n did show the connection, i.e.:

$ netstat -n 
Proto Recv-Q Send-Q Local Address          Foreign Address        State
tcp       0      0 0.0.0.0:5555               0.0.0.0:*              LISTEN
tcp       0      0 **192.168.0.169:5555**     192.168.0.50:51178     ESTABLISHED
tcp6      0      0 ::ffff:127.0.0.1:47514 :::*                       LISTEN

Barry



来源:https://stackoverflow.com/questions/27790445/fixed-cant-connect-to-adb-over-wifi

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