adbd in TCP listen mode by default?

Search This thread

cj64

Senior Member
Dec 26, 2007
51
62
At my university, the lab computers are locked down and won't allow the installation of Android's USB drivers. This prevents adb from connecting to the ADP1 via USB, but I can use another computer which does have USB permissions and use

Code:
adb tcpip 2222

to restart adbd in TCP listen mode on port 2222. Then, on a lab computer I can connect to the ADP1 using

Code:
adb connect <IP>:2222

and install packages, open a shell, etc.

My question is, how can adbd be preconfigured on the ADP1 to listen on a specified port on boot, instead of waiting for a USB connection and the above two commands?

This is "insecure" but it doesn't matter because the lab computers and wireless network are private, and the ADP1 has no SIM card and connects to the internet only via WiFi.

It seems that one way to do this involves editing the boot image to modify init.rc --- I'm prepared to do that, but I'm hesitant to spend the time trying it because I can't find any documentation saying what port adbd will listen on by default, or if it will listen on TCP at all.

tl;dr: Instructions on how to start adbd on boot in TCP listen mode? Thanks.
 
Last edited:
  • Like
Reactions: balamu96m

bohlool

Senior Member
Jun 21, 2010
100
12
Did you find any answer to this? anybody knows how to enable it directly on phone without usb cable?
 

Gerdal

Member
Sep 30, 2007
48
1
xirit.pl
http://nookdevs.com/ADB_Over_USB

"By default, you won't be able to use adb over wifi, using this module/adbd. But if you set the persist.adb.tcp.port system property setprop persist.adb.tcp.port 5555 it will cause adbd to listen on the specified port so you can use adb over both usb and wifi. Note that adb over wifi is insecure and not recommended. Anyone on the same local network could potentially connect to your nook."

Maybe this will help you? :)
 
Last edited:
  • Like
Reactions: ze7zez

bohlool

Senior Member
Jun 21, 2010
100
12
Not working

http://nookdevs.com/ADB_Over_USB

"By default, you won't be able to use adb over wifi, using this module/adbd. But if you set the persist.adb.tcp.port system property setprop persist.adb.tcp.port 5555 it will cause adbd to listen on the specified port so you can use adb over both usb and wifi. Note that adb over wifi is insecure and not recommended. Anyone on the same local network could potentially connect to your nook."

Maybe this will help you? :)

Thanks, but it didnt work. I tried the command in su mode, even restarted the adb service with stop/start command, no error but still can't connect to device over wifi. I can ping the device, so the connection is there. Any idea?
 

bohlool

Senior Member
Jun 21, 2010
100
12
Solved

I finally solved the problem. these are the commands to enable adb over wifi:


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

and to disable it:


Code:
setprop service.adb.tcp.port -1
stop adbd
start adbd


I assume you need su access to run it. I tested it and its working.
 
  • Like
Reactions: Aleq

m32

Senior Member
Jul 10, 2007
266
12
Szczecin
I finally solved the problem. these are the commands to enable adb over wifi:
setprop service.adb.tcp.port 5555
[/CODE]

setprop has sucefully executed - no problem
how to restart this service ?
stop/start shows bad command or filename - which means command not found what is true since there is no shell command named start or stop
 

bohlool

Senior Member
Jun 21, 2010
100
12
Worked for me

I finally solved the problem. these are the commands to enable adb over wifi:
setprop service.adb.tcp.port 5555
[/CODE]

setprop has sucefully executed - no problem
how to restart this service ?
stop/start shows bad command or filename - which means command not found what is true since there is no shell command named start or stop


It worked for me. you can use my Widget to do it and see if it work or not, search market for "ADB over Wifi"
 

u-foka

Member
Sep 21, 2008
48
8
Hy!

I found my way of doing the same thing...
You have to enable dropbear ssh server on your device, and then you can forward the port 5037 (where adb listens by default on localhost only) to your computer trough ssh from your computer.

From your linux box, you can do this with this command:
ssh root@192.168.3.109 -L 5555:localhost:5037
and then (but keep the ssh session open):
adb connect localhost

that's it :)
(note that you have to enable usb debugging for this to work!)
 
  • Like
Reactions: GoodSoul

jcarrz1

Retired Recognized Developer
May 26, 2009
1,633
1,430
scienceprousa.com
Hy!

I found my way of doing the same thing...
You have to enable dropbear ssh server on your device, and then you can forward the port 5037 (where adb listens by default on localhost only) to your computer trough ssh from your computer.

From your linux box, you can do this with this command:
ssh root@192.168.3.109 -L 5555:localhost:5037
and then (but keep the ssh session open):
adb connect localhost

that's it :)
(note that you have to enable usb debugging for this to work!)

that's pretty convenient. thanks.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    At my university, the lab computers are locked down and won't allow the installation of Android's USB drivers. This prevents adb from connecting to the ADP1 via USB, but I can use another computer which does have USB permissions and use

    Code:
    adb tcpip 2222

    to restart adbd in TCP listen mode on port 2222. Then, on a lab computer I can connect to the ADP1 using

    Code:
    adb connect <IP>:2222

    and install packages, open a shell, etc.

    My question is, how can adbd be preconfigured on the ADP1 to listen on a specified port on boot, instead of waiting for a USB connection and the above two commands?

    This is "insecure" but it doesn't matter because the lab computers and wireless network are private, and the ADP1 has no SIM card and connects to the internet only via WiFi.

    It seems that one way to do this involves editing the boot image to modify init.rc --- I'm prepared to do that, but I'm hesitant to spend the time trying it because I can't find any documentation saying what port adbd will listen on by default, or if it will listen on TCP at all.

    tl;dr: Instructions on how to start adbd on boot in TCP listen mode? Thanks.
    1
    http://nookdevs.com/ADB_Over_USB

    "By default, you won't be able to use adb over wifi, using this module/adbd. But if you set the persist.adb.tcp.port system property setprop persist.adb.tcp.port 5555 it will cause adbd to listen on the specified port so you can use adb over both usb and wifi. Note that adb over wifi is insecure and not recommended. Anyone on the same local network could potentially connect to your nook."

    Maybe this will help you? :)
    1
    Solved

    I finally solved the problem. these are the commands to enable adb over wifi:


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

    and to disable it:


    Code:
    setprop service.adb.tcp.port -1
    stop adbd
    start adbd


    I assume you need su access to run it. I tested it and its working.
    1
    Hy!

    I found my way of doing the same thing...
    You have to enable dropbear ssh server on your device, and then you can forward the port 5037 (where adb listens by default on localhost only) to your computer trough ssh from your computer.

    From your linux box, you can do this with this command:
    ssh root@192.168.3.109 -L 5555:localhost:5037
    and then (but keep the ssh session open):
    adb connect localhost

    that's it :)
    (note that you have to enable usb debugging for this to work!)