Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to switch between adb usb to adb tcp mode successfully

I have two device from which one supports adb over usb and another supports adb over ethernet(tcp) as it doesn't have wifi I need to connect it using ethernet for internet access. Whenever I need to switch between the two devices I need to restart the PC to connect with adb successfully which is quite irritating. I tried to switch between usb to tcp but failed so the solution currently I am having is restart the PC everytime. So, here I am looking for a better solution which will save me from restart my PC for switching between usb to tcp or vice-versa mode.

Now, the problem I am facing swiching between usb to tcp is as below

C:\Users\plalit>adb tcpip 5555
restarting in TCP mode port: 5555

C:\Users\plalit>adb connect 192.168.1.137
not implement

C:\Users\plalit>adb connect 192.168.1.137
not implement

Also, I tried adding port number

C:\Users\plalit>adb connect 192.168.1.137:5555
not implement

As you can see it say "not implement", also if I try to kill adb and restart it then it give me a message as below

C:\Users\plalit>adb kill-server
* server not running *

So, I am able to connect the device via usb(one device) but not able to connect another device via tcp for that I need to restart my PC.

Ways I had already tried,

  • Restarting eclipse
  • Killing adb.exe from Task Manager(but there is not process with adb.exe)
  • Restarting adb from eclipse DDMS

Does anyone have a solution for this or has anyone faced this kind of issue/problem, anyways to resolved it.

like image 808
Lalit Poptani Avatar asked May 14 '14 06:05

Lalit Poptani


People also ask

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.

How do I disable ADB tcpip?

To kill the server currently running you need to type: adb kill-server in command prompt. This should stop the instance of a running server.


1 Answers

There is an app for that:) It's called "Adb wireless" but you need root access on your "ethernet only" device.

In order to make those commands adb tcpip 5555 and adb connect <ip>:<port> work over tcp I believe you need to connect your device via usb cable first, and only then you can enable the tcpip connection manually.

If your device is rooted you should be able to use a terminal emulator and start adb on it manualy see here:https://stackoverflow.com/a/3740005/1505341 also pretty the much same thing here:http://takeshikanemoto.wordpress.com/2012/07/08/adb-over-tcpip/

The "Adb wireless (no root)" apps on google play also requires you to connect your device via usb first, that's how/why they don't require root access I believe.

Another related blog post says:

What to do if you don’t have a USB cable from the begining?

If you don’t have a USB cable at first, then you need to root your device first then run the following command on your device:

setprop service.adb.tcp.port 5555

Then you need to stop/restart the adb daemon:

stop adbd

start adbd

How to switch back to USB transport mode?

adb usb

But there is one caveat

This only works since Android 4.0 (ICS). If you have to develop/hack on other Android versions then you need to root that device (in order to use ADB in unsecure mode).

source

like image 136
Kerem Avatar answered Oct 23 '22 15:10

Kerem