adb with wifi

Post Reply
synportack24
Posts: 114
Joined: Sat Jan 10, 2015 10:16 am
languages_spoken: English, German, Korean
ODROIDs: C0, C1, C1+, C2, XU4
Location: 대한민국 - 안양시
Has thanked: 0
Been thanked: 3 times
Contact:

adb with wifi

Post by synportack24 »

Found this to be helpful figured I would share:

In Android
Open terminal and type the following (note: su might require you to allow root permission)

Code: Select all

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
this allows for TCP debugging on port 5555, setting the port to -1 will turn of TCP debugging and default back to USB. While you on you're android device take not of it's IP.


On the Computer
open terminal and type the following, assume the android device has an ip of 192.168.0.123

Code: Select all

adb tcpip 5555
adb connect 192.168.0.123:5555
adb devices
this will tell adb to restart the daemon and listen on port 5555, then attempt to connect to the android device. The last command is not needed but is helpful and will list all connected devices. Past this you can use adb shell or debugger from Android Studio as normal.
http://magazine.odroid.com/
submit an article get cool stuff!

Phoenix9653
Posts: 18
Joined: Sun Sep 13, 2015 11:20 pm
languages_spoken: english
ODROIDs: C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: adb with wifi

Post by Phoenix9653 »

Thanks i was wondering how to init adb over wifi w/o hooking up to a cord first. Thank you

User avatar
odroid
Site Admin
Posts: 40561
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3011 times
Been thanked: 1671 times
Contact:

Re: adb with wifi

Post by odroid »

Yes! This guide is really useful. My table is much clearer than before. :D

himi
Posts: 8
Joined: Fri May 10, 2019 12:43 am
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: adb with wifi

Post by himi »

I tried to enable this persistent on an odroid N2 (on a local machine, not connected to the internet).
Using the terminal (superuser):

Code: Select all

su
mount -o rw,remount /system
echo "adb.tcp.port=5555" > /vendor/default.prop
mount -o ro,remount /system
However now it is stuck at the android boot logo.
Any suggestions how to permanently open port 5555?
And how to fix the boot loop :roll: ?
Last edited by himi on Mon Sep 05, 2022 7:01 pm, edited 2 times in total.

User avatar
mad_ady
Posts: 11207
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 1058 times
Contact:

Re: adb with wifi

Post by mad_ady »

Your command overwrote default.prop, which may cause the bootloop. You'll probably need to write back the original one.

User avatar
rooted
Posts: 9973
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 778 times
Been thanked: 581 times
Contact:

Re: adb with wifi

Post by rooted »

It would be:

Code: Select all

su
mount -o rw,remount /system
echo "adb.tcp.port=5555" >> /vendor/default.prop
ro (read only) in your mount option should be rw (read write) and in your echo statement you need two >> (append text) instead of one > (overwrite)

If you used what you posted it shouldn't have overwritten the prop file as /system would have been in read only mode.

himi
Posts: 8
Joined: Fri May 10, 2019 12:43 am
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: adb with wifi

Post by himi »

@mad_ady
yes, that was the intention. Do you have any suggestion where to open the port persistent?

@rooted
Hey, sorry, that was a mistake in the forum post. Of course I wrote "rw" on the device. edited it.

himi
Posts: 8
Joined: Fri May 10, 2019 12:43 am
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: adb with wifi

Post by himi »

Okay, tried again with a fresh installed android and now it seems to work.
Please note this might be very unsecure on a device connected to an open network.
This was the whole procedure:

1) android developer options --> enable root
2) start terminal emulator (on promt give superuser permission)

Code: Select all

su
mount -o remount,rw /vendor
echo "adb.tcp.port=5555" >> /vendor/default.prop
3) check if everyhing is alright

Code: Select all

cat /vendor/default.prop
4) edit manually if necessary (save and exit with ZZ)

Code: Select all

busybox vi /vendor/default.prop
5) reboot and now it should be accessible via network from another machine

Code: Select all

adb connect 192.168.178.xyz
** EDIT **

since I had problems with access again and after reboot had to call this from terminal:

Code: Select all

stop adbd
start adbd
I installed the app "WiFi ADB - Debug Over Air" which automatically opens the port on ethernet connection.
Here is also a xda thread dealing with that topic: https://forum.xda-developers.com/t/moun ... t-82521979

It would be nice to have this as a setting in the odroid settings app.
These users thanked the author himi for the post:
odroid (Tue Sep 06, 2022 8:36 am)

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 1 guest