I am attempting to debug an application on a Motorola Droid, but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64-bit VM running in Hyper-V, and so I cannot connect directly via USB in the guest or from the host.
I installed a couple of different USB-over-TCP solutions, but the connection appears to have issues since the ADB monitor reports "devicemonitor failed to start monitoring" repeatedly. Is there a way to connect directly from the client on the development machine to the daemon on the device using the network instead of the USB connection or possibly another viable options?
I do not know how to connect the device without any USB connection at all, but if you manage to connect it maybe at another computer you can switch the adbd to TCP mode by issuing
from a terminal and connect to your device over wifi from any PC on the network by:
Maybe it is also possible to switch to TCP mode from a terminal on the device.
You can also use SSH local port forwarding. But it still involves a USB cable. Connect your phone using USB to a computer (host) with an sshd running. On a remote (guest) pc start an SSH client capable of portforwarding/tunneling. Example:
I use this construction to connect my device to a virtual machine. Eltima USB to Ethernet wasn't stable enough (timeouts during debug).
SSH tunneling works for free and is more reliable.
I just followed following steps and it started working, so that i can connect to my android device.
Step 1: Open the terminal Window in Android Devices and execute the following command.
Step 2: Through ADB, Execute the bellow command.(From the path where ADB is configured)
adb connect 10.10.10.50:5555 - Here 10.10.10.50 is the IP address of the android device and 5555 is the port number.
Weird, but this only works for me if I have the USB cable connected, then I can unplug the usb and go for it with everything else adb.
and the same when returning to usb,
will only work if usb is connected.
It doesn't matter if I issue the
or
then stop & start adbd, I still need the usb cable in or it doesn't work.
So, if my ADB over usb wasn't working, I bet I wouldn't be able to enable ADB over WiFi either.
This is really simple if your phone is rooted.
Download a terminal emulator from Google Play (there are lots that are free). Make sure that your Android device is connected to your Wi-Fi and get the Wi-Fi IP address. Open the terminal program and type:
Now go to your computer (assuming that you are using Windows) and create a shortcut on the desktop for "cmd.exe" (without the quotations).
Right click on the cmd shortcut and choose
"Run as Administrator"
Change to your
android-sdk-windows\tools
folderType:
adb should now say that you are connected.
Note: if you are too fast to give the connect command it may fail. So try at least two times five seconds apart before you say this doesn't work.
I put together a batch file for automatic enabling and connecting ADB via TCP, to a device connected via USB. With it you don't have to put in the IP manually.