Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to connect Android ADB over TCP/IP

Tags:

android

tcp

adb

I'm trying to get the Android Debug Bridge working over wifi from my 64-bit Windows 7 desktop computer to my Nexus10. I connect the device over USB, and then I followed "How can I connect to Android with ADB over TCP?, but I end up with an error message that it can't connect:

C:\adt-bundle\sdk\platform-tools>adb usb
restarting in USB mode

C:\adt-bundle\sdk\platform-tools>adb devices -l
List of devices attached
R32D300NXJV            device product:mantaray model:Nexus_10 device:manta


C:\adt-bundle\sdk\platform-tools>adb tcpip 5555
restarting in TCP mode port: 5555

C:\adt-bundle\sdk\platform-tools>adb connect 192.168.231.2
unable to connect to 192.168.231.2:5555

To start debugging this, I tried pinging the Nexus10 from my desktop computer. Both devices are connected to the same router, by a cable in the case of the desktop computer, and wirelessly for the Nexus10. However, I got

C:\adt-bundle\sdk\platform-tools>ping 192.168.231.2

Pinging 192.168.231.2 with 32 bytes of data:
Reply from 192.168.231.61: Destination host unreachable.
Reply from 192.168.231.61: Destination host unreachable.
Reply from 192.168.231.61: Destination host unreachable.
Reply from 192.168.231.61: Destination host unreachable.

Ping statistics for 192.168.231.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

The IP address 192.168.231.61 which returns "Destination host unreachable" is the IP address of my desktop computer. Although the ping doesn't work, I don't know whether the fact that I can't ping is the source of my ADB problem or whether it's unconnected to the issue.

I'm running Android Debug Bridge version 1.0.31. Can anyone help?

like image 685
Stochastically Avatar asked Apr 07 '13 08:04

Stochastically


People also ask

How do I enable adb over TCP IP?

Type adb tcpip 5555 in the command line or Terminal and press Enter. Find your phone's IP address in Settings > About Phone > Status > IP Address. Back in the command line or Terminal, type adb connect [your Android's IP address]. Finally, press Enter again.

Does adb use TCP?

When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server. As shown, the emulator connected to adb on port 5555 is the same as the emulator whose console listens on port 5554.

Why adb connect not working?

Failed ADB connections usually have one root cause: bad Android USB drivers that load in place of the right ones. Windows doesn't make it easy to remove the wrong drivers, unfortunately. But before attempting to troubleshoot an ADB connection, first enable USB debugging on your phone if it's not on already.


2 Answers

This must have been a networking problem, because when I connected via a wireless network on a different subnet, then (1) I was able to ping the nexus10 from my desktop, and (2) ADB connected over TCPIP OK. So my conclusion is that my desktop/router/nexus10 had some bizarre routing incompatibility when on the same subnet, when disappeared when they were on different subnets.

Thanks anyway.

like image 155
Stochastically Avatar answered Oct 28 '22 23:10

Stochastically


I have problems both with my nexus 4 and my nexus 10 on the same wifi as my laptop. The nexus 4 I have had more time to experiment with, and what helps is either rebooting the phone, or using "DNS Hostname Changer" to restart networking and then I can connect again.

The Nexus 10 seems to be a bit worse than Nexus 4 though....

like image 37
sandos Avatar answered Oct 29 '22 01:10

sandos