How can I connect to Android with ADB over TCP?

Posted: June 5, 2011 in Android, Java, WiFi

Title : How can I connect to Android with ADB over TCP?

Question 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 64bit VM running in HyperV 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. I was wondering if there is 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 other viable options?

 

Solution According to a post on xda-developers, you can enable ADB over WiFi from the device with the commands setprop service.adb.tcp.port 5555stop adbdstart adbd And you can disable it and return ADB to listening on USB with setprop service.adb.tcp.port -1stop adbdstart adbd If you have USB access already, it is even easier to switch to using WiFi. From a command line on the computer that has the device connected via USB, issue the commands adb tcpip 5555adb connect 192.168.0.101:5555 To tell the ADB daemon return to listening over USB adb usb There are also several apps on the Android Market that automate this process. Solution from adb –help connect : – connect to a device via TCP/IP Thats a command line option by the way. You should try connecting the phone to your wifi, and then get its IP from your router, its not going to work on the cell network The port is 5554 Solution Have you found anything? Basically, how to start the adb daemon on the phone without a USB connection ?

 

Solution 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 adb tcpip from a terminal and connect to your device over wifi from any PC on the network by: adb connect : Maybe it is also possible to switch to TCP mode from a terminal on the device.

 

Solution this is really simple. 1st make sure you are rooted.download a terminal emulator from market. (there are lots that are free)make sure that your android is connected to your wifi and get the wifi ip address.open the terminal program and type: su setprop service.adb.tcp.port 5555 stop adbd start adbd now go to your computer (assuming that you are using windows) 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 folder type: adb connect wifi.ip.address:5555 (example: adb connect 192.168.0.105:5555) 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 2 times 5 seconds apart before you say this doesn’t work.

 

Solution I ended up getting the Eltima USB to Ethernet software working after finally giving up on the possibility of a direct to device connection over TCP. I have pretty much decided that it is not possible to connect to a device across the network only an emulator. If anyone finds out differently please update this post. thanks

 

Reference

http://techsoftcomputing.com/faq/3623727.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s