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.
Luis
source share