How to Control Both Moto G and Moto E LEDs

Notification LEDs offer a great way to check for notification at a glance on the Moto G (2013) and … more

LG G3 Receives Oversharpening Fix via Modified Kernel

Nothing is perfect, as they say. No matter how alluring or seemingly perfect, … more

APKTool Updated with Android Lollipop Support

One of the beauties of Android is the level of flexibility we have over our devices. Whether … more

Lollipop Leak for Sprint Galaxy S5, TWRP for Micromax Canvas Magnus – XDA TV

Android 5.0 Lollipop has been leaked for the Sprint … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

adbd in TCP listen mode by default?

OP cj64

18th February 2010, 06: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 06:59 PM. Reason: spelling/grammar errors
The Following User Says Thank You to cj64 For This Useful Post: [ View ]
13th August 2010, 08: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, 10: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 10:32 PM.
14th August 2010, 07: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, 08: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, 07: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, 07: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"
11th January 2011, 12:48 AM   |  #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, 01:33 AM   |  #9  
jcarrz1's Avatar
Retired Recognized Developer
Thanks Meter: 1,432
 
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, 12:15 PM   |  #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