Linux command
adb-reverse 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Reverse forward
adb reverse tcp:[8080] tcp:[8080]
List
adb reverse --list
Remove
adb reverse --remove tcp:[8080]
Example
adb reverse --remove-all
说明
adb reverse sets up reverse port forwarding from the Android device to your computer. This allows apps on the device to connect to services running on your development machine as if they were running locally on the device. This is commonly used for connecting React Native apps to the Metro bundler, or allowing device apps to access local development servers.
参数
- tcp:_port_
- TCP port number
- localabstract:_name_
- Unix domain socket in abstract namespace
- --no-rebind
- Fail if remote port is already forwarded
- --list
- List all active reverse forwards
- --remove _remote_
- Remove specific reverse forward rule
- --remove-all
- Remove all reverse forward rules
FAQ
What is the adb-reverse command used for?
adb reverse sets up reverse port forwarding from the Android device to your computer. This allows apps on the device to connect to services running on your development machine as if they were running locally on the device. This is commonly used for connecting React Native apps to the Metro bundler, or allowing device apps to access local development servers.
How do I run a basic adb-reverse example?
Run `adb reverse tcp:[8080] tcp:[8080]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does tcp:_port_ do in adb-reverse?
TCP port number