One can forward a port with adb forward tcp:8080 tcp:8080
. But do I need to kill the adb server to stop this forwarding?
I'm looking for a way to stop forwarding of a port in adb, after it was set up, but when the forward is no longer needed.
I'm developing an Android app as a side project and today I learned about adb forward and adb reverse . Basically, they allow you to forward or reverse traffic to specific ports between an Android device and your development machine.
$ adb reverse --list. Reverse a TCP port from an emulator or device to localhost.
All ADB clients listen to 5037 TCP port to communicate with server request. Now, the running ADB server can scan all connected emulator or device instances by scanning the port. Always remember that ADB daemon runs on odd numbered port between the ranges of 5555 to 5558.
Try adb forward --remove tcp:8080
, or adb forward --remove-all
.
This was added to adb in December 2012 (see patch here). The SDK update released for Android 4.3 (API 18) was the first to support it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With