How to disable adb port forwarding?

How to disable ad port forwarding rule that was previously enabled with

adb forward tcp:1234 tcp:1234 

Is there any other way besides killing and restarting the adb server?

+7
source share
2 answers

Configure redirection via ADB

The Android Debug Bridge (ADB) tool provides port forwarding, an alternative way to configure network forwarding. For more information, see Port Forwarding in the ADB documentation.

You can also remove the redirect by killing the ADB server.

However, you can use the network redirection provided by the emulator console, which provide removal methods. Access Type:

telnet localhost emulator_port

usually the first emulator runs on port 5554.

use the "rdir" command to add, del or a network redirect list.

See the documentation in Using Network Redirection .

Good luck.

EDIT:

To stop forwarding, use

adb forward --remove tcp:<port> 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.

+6
source

Try adb forward --remove tcp: 8080 or adb forward --remove-all.

This was added to adb in December 2012.

+1
source

All Articles