User Tools

Site Tools


docu:tutos:android:adb_tcp_forwarding

This is an old revision of the document!


Forwarding adb over TCP/IP (Mostly Wifi)

Today we are going to learn how to use adb tcp forwarding
to access an android phone shell (or screen) using multiple tcp/ip port forwardings

First, connect the phone via usb (this is needed) and issue:

# You can choose any port you want
adb tcpip 5557
 
# Save the phone ip somewhere
adb shell ifconfig

Once this is enabled, you can stop using the usb cable

To connect to the adb device by it's ip address:

adb connect [YOUR_PHONE_IP]:5557
# or disconnect later
adb disconnect [YOUR_PHONE_IP]:5557

You can now access the phone shell or screen via tcp/ip

adb shell
scrcpy # gui tool from genymotion to view the phone screen over adb

Forwarding adb over USB and TCP/IP

There can be a case when you want to use a device connected to a server by usb
You can do this easily by enabling tcpip mode on adb and forwarding the port

docu/tutos/android/adb_tcp_forwarding.1581077089.txt.gz · Last modified: 2020/02/07 12:04 by admin