3

Starting from Android 4.0, there is a "adb" command in "system/bin" folder

Using this, i want to run adb server/client inside Android OS and connect to itself.

I am trying to accomplish this by "terminal emulator" installed on my non-rooted phone Galaxy S3.

I executed these commands:

adb devices

setprop service.adb.tcp.port 5555

stop adbd

start adbd

adb kill-server

adb devices

At this point it is supposed to show device itself "emulator-5554" But it is showing nothing.

I followed this blog: http://blog.kmckk.com/archives/4092970.html

ahikmat
  • 111
  • 1
  • 2
  • 6
  • In short, root privilege is required. [See this Q&A][1] [1]: http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp?rq=1 – S.M.Mousavi Apr 13 '15 at 07:04

4 Answers4

1

The mistake in that blog is quite big.

The reason setprop service.adb.tcp.port 5555 is executed is to allow ADB daemon to be run in TCP mode at port 5555 (it is meant to run ADB wirelessly) so that other devices in the same local network can connect to your device at port 5555.

Before running adb devices you've to connect your device to the ADB server running at port 5555, and to do that enter:

adb connect localhost:5555

Now type adb devices and you would see your device.


You don't need root to run ADB wirelessly on the device.

Firelord
  • 378
  • 5
  • 22
  • "could not set property". my phone is Verizon (probably the cause) HTC One M7, android 5.0.2, lollipop – tylerr147 Oct 26 '16 at 20:08
  • nevermind. The initial command needs to be from a computer. and i just use `adb tcpip [PORT]` – tylerr147 Dec 03 '16 at 01:18
  • Is 5555 is only for local wireless connection? I fi want to connect my android device over the internet i need another port? – Moshe Yamini Sep 13 '20 at 19:57
  • @MosheChernysh I am only aware of the possibility of using adb for local connections. For adb over internet, I think a proper question on it would be a good thing. :-) – Firelord Sep 13 '20 at 21:13
  • Thanks! I already asked here: https://stackoverflow.com/questions/63871137/adb-connect-through-internet – Moshe Yamini Sep 13 '20 at 21:26
0

I did try the same on my rooted Odroid-C1 and it works (so thank for the link!). But on my Galaxy S4 non-rooted it did not work. So I guess the answer here is: you need a rooted device.

DeDenker
  • 349
  • 3
  • 13
0

Note : my device is not rooted

I have installed adb in Termux by using this https://github.com/MasterDevX/Termux-ADB

in terminal emulator executed these commands :

cd /system/bin
start adbd

now in termux , adb automatically connected to emulator-5554(device itself):

$adb devices
emulator-5554        device

I don't know how it worked, but it worked like a charm

David Buck
  • 3,439
  • 29
  • 24
  • 31
mk_369
  • 1
  • 1
  • It was just emulator not actual device. If your command would have worked then adb devices would have outputted device and not emulator. Access to system/bin folder without root access is next to impossible – Tathastu Oct 10 '20 at 12:29
-2

Anyway, i successfully authorized my device, by CHMOD-ing the /data/local/tmp/ into 777 rwxrwxrwx