ADB Basics Android 1.0+ Risk: SAFE

Forward Socket Connection

Forwards socket connections from a host computer port to an Android device port.

Command Syntax

adb forward
Generic Syntax: adb forward <local> <remote>

Options & Parameters

Flag Description
--list List all active socket forwarding connections.
--remove <local> Remove a specific forward.
--remove-all Remove all socket forwards.

Real-World Usage Examples

Forward TCP port 8080 to device port 8080
Forwards local port 8080 to Android web server.
adb forward tcp:8080 tcp:8080
List all active port forwards
Outputs active port forwards.
adb forward --list
Output:
RF8M90ABCDEF tcp:8080 tcp:8080