Help with using ADB commands wirelessly? - General Questions and Answers

I have a phone (Samsung A10E) that will not connect to the PC via USB (It's not the PC, I have a second of the same phone which connects fine, so SDK install and phone drivers are good). It is not rooted.
Is there anyway to perform ADB TCPIP 5555 on the phone itself or otherwise set the phone to accept wireless ADB commands with only the phone? (also no wireless debugging option available under Dev Options).
Thx for any suggestions!

NO.
A working ADB USB-connection is required to run
Code:
adb tcpip 5555
command

Related

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:
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.
Did you find any answer to this? anybody knows how to enable it directly on phone without usb cable?
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?
Not working
Gerdal said:
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?
Click to expand...
Click to collapse
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?
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.
bohlool said:
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
Click to expand...
Click to collapse
Worked for me
m32 said:
bohlool said:
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
Click to expand...
Click to collapse
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"
Click to expand...
Click to collapse
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 [email protected] -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!)
u-foka said:
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 [email protected] -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!)
Click to expand...
Click to collapse
that's pretty convenient. thanks.
Thanks and this works for me!!!
bohlool said:
Code:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Click to expand...
Click to collapse

adb troubles

ive used adb before on a friends computer and on my computer (a macbook pro) in the past and know the works but recently on my computer when i connect any device including my skyrocket with usb debugging on and i try to run adb using the command ./adb shell it starts to run, then says error- no device recognized. any ideas?
Check device USB driver

execute "adb tcpip <port_no>" command without using usb

NON ROOTED PHONE
I am trying to create to backup of all application in android but I don't want the users to connect to USB even for the first time.
okay let me first explain what happens when we connect our phone with USB to ADB client
0. USB Debugging mode is enabled in the phone.
1. The phone is connected to PC using a USB cord.
2. We run
Code:
adb tcpip 9999
command from cmd with ADB already installed.
The above command helps now switched the abd demon (adbd) inside the android phone to listen through TCP-IP protocol
3. now we can disconnect the phone from the PC
4. using a terminal emulator application we can now fire the commands
a)
Code:
adb connect localhost:999
b)
Code:
backup -all -f /sdcard/dev/bck.ab
now a backup pop-up will open up, you can simply click backup button.
Now we can anytime execute the command in 4.a and 4.b util the user restarts the phone or
but the problem is I wish to execute
Code:
adb tcpip 9999
without PC. Can someone suggest me how to approach this problem. From where should I start reading or there is some existing application that can do this on a non-root phone.

How to add WiFi network over ADB without root?

If a device has no root, what ADB commands can I use to connect that device to WiFi? I need to be able to input SSID name, password, static local IP, DNS, etc. - all over ADB and without root.
I am not talking about ADB over WiFi over TCP port 5555. I am talking about connecting an Android device via USB cable and the connecting that Android device to WiFi, assuming the device has no WiFi networks added.
To bring up Android's Wi-Fi Settings via ADB you run
Code:
adb devices
adb shell "am start -a android.settings.WIFI_SETTINGS"
I'm not sure I understand the OP's question where it matters greatly whether the OP is on non-rooted Android 10 and below or non-rooted Android 11 and above.
Non-root Android 11 and above no longer needs the USB cable for adb to connect between Android and the PC via Wi-Fi.
There's more information here...
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
(PSA) Using the new Android 12 TILE for 'Developer options' 'Wireless debugging' to establish adb connection over Wi-Fi without USB
What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?
some newer devices, like Samsung will let you use cmd binary.
So to connect to network look at "adb shell cmd wifi"
Currently, it's somethig like $ adb shell cmd wifi connect-network bssid passphrase network_type

adb over ethernet in Android 11

Hi. I've been playing with connecting my phone via ethernet, and notice that since (stock) android 11, enabling wireless debugging no longer enables generic local network adb access, it's now specifically for wireless only adb. Anyone know if there's a way to enable ethernet adb debugging, or where I can ask Google about it?
try
setprop persist.adb.tcp.port 5555
stop adbd
start adbd
adb connect <device ip>:5555
Ah, great idea, but requires root and I have not rooted or replaced the rom. Guess I may just have to wait until I have enough time, I suppose the warranty is close to finished.

Categories

Resources