adb-forward
TLDR
Forward local port to device port
SYNOPSIS
adb forward [--no-rebind] local remote
adb forward --list | --remove local | --remove-all
DESCRIPTION
adb forward sets up port forwarding from a local port on your computer to a port on the connected Android device. This enables connecting to services running on the device as if they were running locally.
Common uses include debugging apps with remote debuggers, accessing development servers running on the device, or connecting to app-specific sockets.
PARAMETERS
tcp:port
TCP port numberlocalabstract:name
Unix domain socket in abstract namespacelocalreserved:name
Unix domain socket in reserved namespacelocalfilesystem:name
Unix domain socket in filesystem namespacejdwp:pid
JDWP (Java Debug Wire Protocol) for process ID--no-rebind
Fail if local port is already forwarded--list
List all active port forwards--remove local
Remove specific forward rule--remove-all
Remove all forward rules
CAVEATS
Port forwards persist until removed, the device disconnects, or the adb server restarts. Both local and remote ports must be available. Firewalls may block forwarded connections.
HISTORY
Port forwarding has been a core adb feature since Android's initial release in 2008, essential for remote debugging of Android applications through JDWP and other protocols.
SEE ALSO
adb(1), adb-reverse(1)


