Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop an adb port forward?

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.

like image 484
n611x007 Avatar asked Jul 23 '13 17:07

n611x007


People also ask

What is adb port forwarding?

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.

What is adb reverse?

$ adb reverse --list. Reverse a TCP port from an emulator or device to localhost.

Which port is used by adb?

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.


1 Answers

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.

like image 87
fadden Avatar answered Sep 29 '22 09:09

fadden