Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,401 Members 38,367 Now Online
XDA Developers Android and Mobile Development Forum

adbd in TCP listen mode by default?

Tip us?
 
cj64
Old
(Last edited by cj64; 18th February 2010 at 05:59 PM.) Reason: spelling/grammar errors
#1  
Member - OP
Thanks Meter 62
Posts: 51
Join Date: Dec 2007
Default adbd in TCP listen mode by default?

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:
Select 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:
Select 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.
The Following User Says Thank You to cj64 For This Useful Post: [ Click to Expand ]
 
bohlool
Old
#2  
Senior Member
Thanks Meter 7
Posts: 100
Join Date: Jun 2010
Did you find any answer to this? anybody knows how to enable it directly on phone without usb cable?
Google Nexus One (T-Mobile), Rooted stock Gingerbread 2.3.3 (Locked boot-loader )

 
Gerdal
Old
(Last edited by Gerdal; 13th August 2010 at 09:32 PM.)
#3  
Member
Thanks Meter 0
Posts: 48
Join Date: Sep 2007
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?
 
bohlool
Old
#4  
Senior Member
Thanks Meter 7
Posts: 100
Join Date: Jun 2010
Default Not working

Quote:
Originally Posted by Gerdal View Post
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?
Google Nexus One (T-Mobile), Rooted stock Gingerbread 2.3.3 (Locked boot-loader )

 
bohlool
Old
#5  
Senior Member
Thanks Meter 7
Posts: 100
Join Date: Jun 2010
Default Solved

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


Code:
Select Code
setprop service.adb.tcp.port 5555
stop adbd
start adbd
and to disable it:


Code:
Select 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.
Google Nexus One (T-Mobile), Rooted stock Gingerbread 2.3.3 (Locked boot-loader )

 
m32
Old
#6  
Senior Member
Thanks Meter 8
Posts: 246
Join Date: Jul 2007
Location: Szczecin
[QUOTE=bohlool;7663651]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
Old
#7  
Senior Member
Thanks Meter 7
Posts: 100
Join Date: Jun 2010
Default Worked for me

[QUOTE=m32;9135353]
Quote:
Originally Posted by bohlool View Post
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"
Google Nexus One (T-Mobile), Rooted stock Gingerbread 2.3.3 (Locked boot-loader )

 
u-foka
Old
#8  
Member
Thanks Meter 7
Posts: 42
Join Date: Sep 2008
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!)
The Following User Says Thank You to u-foka For This Useful Post: [ Click to Expand ]
 
jcarrz1
Old
#9  
jcarrz1's Avatar
Retired Recognized Developer
Thanks Meter 1429
Posts: 1,627
Join Date: May 2009
Quote:
Originally Posted by u-foka View Post
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.
HTC Sensation z710a
T-Mobile G1 on AT&T US (retired)
Asus Transformer TF101-A1

.............................................Click "Thanks" if I helped..........................................
PM me if you have questions.
 
asususer
Old
#10  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Nov 2007
Thanks and this works for me!!!

Quote:
Originally Posted by bohlool View Post
Code:
Select Code
setprop service.adb.tcp.port 5555
stop adbd
start adbd

Tags
adbd, init.rc, tcp, tcpip
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...