21

I need remote ADB shell.. I know that we have to issue "ADB tcpip ".. to change ADB server to TCP listening mode.

But, the problem is that my phone is not rooted, and I do not have USB cable. I can't issue tcpip command since I do not have USB cable,, I can't change default.prop file as the phone is not rooted.

Is there any other ways to change ADB server to TCP listening mode???

Jason Hwang
  • 227
  • 1
  • 2
  • 3

5 Answers5

1

I found an articel that says you can execute setprop persist.adb.tcp.port 5555 to make tcpip mode autostart after reboot.

The problem is, you must run this command as root.

On my device unfortunally the command su doeas not exist.

Here is the orginal Permanent network debugging on android

EDIT: I discovered, that the su command is only available when your device is rooted. So the solution only works when you have a rooted phone

Radon8472
  • 4,285
  • 1
  • 33
  • 41
0

The simple answer is: no, you can't.

As you said, you can't access the prop file and don't have a cable to change with ADB. The only way is you find the port via an Android terminal emulator (a.k.a Termux)

0

For anyone looking for a better answer: YES, YOU CAN!!

When you try to execute "adb tcpip 5555" without an USB cable, it returns: "error: no devices/emulators found"

Emulators?? After googling I found the way and made a batch file that connects my device directly through WIFI, no cables needed at all:

set /p ip= Device IP: 

:CONNECT
if "%CD%"=="C:\" goto ROOT
cd ..
goto CONNECT

:ROOT
cd ...Android\Sdk\emulator
echo.
echo Starting emulator...
start /MIN emulator -avd Nexus_5X_API_29_x86 -no-window
(you can check other avaliable devices with "emulator -list-avds")

cd ..
cd platform-tools
adb wait-for-device
echo.
echo Emulator started.
echo Connecting with device...
adb tcpip 5555
adb connect %ip%
echo.
echo Closing emulator...
(you need it just to be able to execute "adb tcpip 5555")
adb -s emulator-5554 emu kill
(you can check the name with "adb devices")
  • It does not work! cannot connect to 192.168.100.121:5555: No connection could be made because the target computer as actively refused. (10061) – Rui Alves Oct 12 '21 at 10:04
-2

To enable wireless debug need to configure the ADB command. (in mac os)

Step1:- First of all need to enable adb command. (check SDK tool and install command-line tools)

Step2:- connect the device with a USB cable after that run the below command.

command: adb devices

the above command will show a list of connected mobiles.

Step3:- after that, we need to configure TCPIP protocol:

e.g : adb tcpip 5556

Step4:- Run command to connect the device.

command: adb connect your_ip:port_address eg:- adb connect 192.168.1.152:5556

Rohit Chaurasiya
  • 597
  • 5
  • 12
-3

If you are using the stock android os system, then you can enable remote debugging in Settting -> developer options.

Frank Cheng
  • 5,928
  • 9
  • 52
  • 80