I am trying to reverse-forward port through ADB, but it just returns cryptic error of error: closed
. Normal forwarding works. Session snippet:
$ adb forward tcp:59778 tcp:59778 $ adb forward --list 015d2109ce0c1a0f tcp:59778 tcp:59778 $ adb forward --remove-all $ adb forward --list $ adb reverse --list error: closed error: closed $ adb reverse tcp:59778 tcp:59778 error: closed error: closed
I am connecting via USB to non-rooted Nexus 7 2012 Android 4.4.4 from Windows 7 Pro x64 on Boot Camp.
In tools menu,Android-> untick enable adb Integration and Then OPEN widows task manager n manually end process adb.exe This also solved my issue as der were multiple adb.exe running. Show activity on this post. Restart the computer. Now, disconnect the device, connect it, Make sure USB debugging Option is enabled.
$ adb reverse --list. Reverse a TCP port from an emulator or device to localhost.
Try adb forward --remove tcp:8080 , or adb forward --remove-all .
Basically means that the requests on specific port on the host will be forwarded to a specific port on the device.
adb reverse
was introduced in Android 5.0
Since adb reverse
is not supported in Android versions lower than 5.0, you need to use an alternative method, for example connecting via Wi-Fi instead. If you are using React Native, Facebook has added official documentation to connect to the development server via Wi-Fi. Quoting the instructions for MacOS, but they also have them for Linux and Windows:
Method 2: Connect via Wi-Fi
You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. You'll need your development machine's current IP address before proceeding.
You can find the IP address in System Preferences → Network.
Make sure your laptop and your phone are on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error. This is OK. The following steps will fix that. Open the in-app Developer menu. Go to Dev Settings → Debug server host for device. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). Go back to the Developer menu and select Reload JS.
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