Gmail 5.0: Material Design and Multiple Account Support

Google started to materialize many of its applications right after announcing the … more

Some of Our Favorite Features in Android 5.0 Lollipop

Android 5.0 Lollipop is the latest major revision to Google’s mobile operating … more

Sony SmartEyeglass SDK Developer Preview Released

A little over a month ago in Tokyo, Japan, Sony unveiled its new SmartEyeglasstechnology. … more

XDA and Leaseweb: Server Trial/Moto 360 Contest (Winners!)

About a month ago, we held a contest along with XDA’s host, Leaseweb, to … more
Post Reply

adbd in TCP listen mode by default?

OP cj64

18th February 2010, 05:47 PM   |  #1  
OP Member
Thanks Meter: 62
 
51 posts
Join Date:Joined: Dec 2007
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 by cj64; 18th February 2010 at 05:59 PM. Reason: spelling/grammar errors
The Following User Says Thank You to cj64 For This Useful Post: [ View ]
13th August 2010, 07:36 PM   |  #2  
Senior Member
Thanks Meter: 7
 
100 posts
Join Date:Joined: Jun 2010
More
Did you find any answer to this? anybody knows how to enable it directly on phone without usb cable?
13th August 2010, 09:29 PM   |  #3  
Member
Thanks Meter: 0
 
48 posts
Join Date:Joined: Sep 2007
More
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 by Gerdal; 13th August 2010 at 09:32 PM.
14th August 2010, 06:16 AM   |  #4  
Senior Member
Thanks Meter: 7
 
100 posts
Join Date:Joined: Jun 2010
More
Not working
Quote:
Originally Posted by Gerdal

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?
14th August 2010, 07:17 AM   |  #5  
Senior Member
Thanks Meter: 7
 
100 posts
Join Date:Joined: Jun 2010
More
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.
10th November 2010, 06:20 PM   |  #6  
Senior Member
Flag Szczecin
Thanks Meter: 8
 
246 posts
Join Date:Joined: Jul 2007
More
[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
11th November 2010, 06:51 AM   |  #7  
Senior Member
Thanks Meter: 7
 
100 posts
Join Date:Joined: Jun 2010
More
Worked for me
[QUOTE=m32;9135353]
Quote:
Originally Posted by bohlool

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"
10th January 2011, 11:48 PM   |  #8  
Member
Thanks Meter: 7
 
42 posts
Join Date:Joined: 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: [ View ]
11th January 2011, 12:33 AM   |  #9  
jcarrz1's Avatar
Retired Recognized Developer
Thanks Meter: 1,430
 
1,627 posts
Join Date:Joined: May 2009
Quote:
Originally Posted by u-foka

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.
27th April 2012, 11:15 AM   |  #10  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Nov 2007
Thanks and this works for me!!!

Quote:
Originally Posted by bohlool

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


Post Reply Subscribe to Thread

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

Advanced Search
Display Modes