Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB over ethernet

I have an android device which I want to connect to using ADB. For reasons that don't matter here I need it to have an ethernet connection, not wifi. The device itself refuses to have both ethernet and wifi connections at the same time.

I have been using a third party app called ADB WiFi to connect to it with ADB when it is in WiFi mode, and I have found that I can connect to it in wifi, then switch the device into ethernet, and then reconnect to the new IP, and it works.

I would dearly like to be able to connect to my device (which is often remote and hard to reach) without first switching it into wifi and back, to which end I have written my own little app which uses SU and does:

setprop service.adb.tcp.port 5555
stop adbd
start adbd

It says that it is working when I run it and produces no error messages, but I can't connect afterwards. It doesn't work in wifi mode either. After setting up a connection once using the 3rd party app, I can then use stop adbd to prevent adb working, and I can use my application above to enable it again, without wifi or 3rd party intervention, which suggests that it is doing what it thinks it is doing, but missing a one off step.

Does anyone know if there is another thing that must be set / enabled / poked in order for adbd to work? Does anyone know what I'm missing?

Thanks

like image 467
Andy Newman Avatar asked Oct 02 '22 22:10

Andy Newman


1 Answers

Have you tried this:

adb tcpip 5555
adb connect 192.168.1.1:5555

replacing the 192.168.1.1 with your phones IP Address?

like image 96
Scott Wardlaw Avatar answered Oct 05 '22 13:10

Scott Wardlaw