Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FIXED: Can't connect to adb over wifi

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

like image 241
Barry Holroyd Avatar asked Jan 06 '15 00:01

Barry Holroyd


1 Answers

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

like image 112
matthieu Avatar answered Nov 05 '22 23:11

matthieu