Andrew
2024-09-23 16:13:55 UTC
What is an adb "reverse tunnel" when connecting Win10 to Android over USB?
I use adb every day after rebooting the desktop every morning.
1. 99 out of 100 times, adb connects with no problems over USB cable.
I don't even worry about ports as it just works.
2. 1 out of 100 times adb fails forever until the PC is rebooted
There is some kind of port conflict between the PC & adb.
3. Then adb again mirrors Android on the PC monitor, keyboard, mouse, etc.
The port conflict magically disappears with a simple reboot.
Why?
Today I decided to capture the log file and noticed a "reverse tunnel".
Could not remove reverse tunnel on port 27189
I have never heard of a reverse tunnel before - so certainly I didn't do it.
Anyone here on Android/Windows newsgroups have experience with this
particular 1 out of 100 failure of adb to connect, which includes
this reverse-tunnel being attempted?
The entire log file before rebooting is shown below for details.
C:\app\editor\android\scrcpy>usb
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
C:\app\editor\android\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 32.1 MB/s (41159 bytes in 0.001s)
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27183, retrying on 27184
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27184, retrying on 27185
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27185, retrying on 27186
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27186, retrying on 27187
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27187, retrying on 27188
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27188, retrying on 27189
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb reverse --remove" returned with value 1
WARN: Could not remove reverse tunnel on port 27189
WARN: Could not listen on port 27189, retrying on 27190
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27183, retrying on 27184
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27184, retrying on 27185
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27185, retrying on 27186
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27186, retrying on 27187
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27187, retrying on 27188
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27188, retrying on 27189
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27189, retrying on 27190
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27190, retrying on 27191
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27191, retrying on 27192
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27192, retrying on 27193
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27193, retrying on 27194
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27194, retrying on 27195
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27195, retrying on 27196
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27196, retrying on 27197
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27197, retrying on 27198
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27198, retrying on 27199
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
ERROR: Could not forward any port in range 27183:27199
ERROR: Server connection failed
C:\app\editor\android\scrcpy>usb
I use adb every day after rebooting the desktop every morning.
1. 99 out of 100 times, adb connects with no problems over USB cable.
I don't even worry about ports as it just works.
2. 1 out of 100 times adb fails forever until the PC is rebooted
There is some kind of port conflict between the PC & adb.
3. Then adb again mirrors Android on the PC monitor, keyboard, mouse, etc.
The port conflict magically disappears with a simple reboot.
Why?
Today I decided to capture the log file and noticed a "reverse tunnel".
Could not remove reverse tunnel on port 27189
I have never heard of a reverse tunnel before - so certainly I didn't do it.
Anyone here on Android/Windows newsgroups have experience with this
particular 1 out of 100 failure of adb to connect, which includes
this reverse-tunnel being attempted?
The entire log file before rebooting is shown below for details.
C:\app\editor\android\scrcpy>usb
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
C:\app\editor\android\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 32.1 MB/s (41159 bytes in 0.001s)
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27183, retrying on 27184
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27184, retrying on 27185
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27185, retrying on 27186
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27186, retrying on 27187
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27187, retrying on 27188
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
WARN: Could not listen on port 27188, retrying on 27189
ERROR: bind: [10013] An attempt was made to access a socket in a way forbidden by its access permissions.
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb reverse --remove" returned with value 1
WARN: Could not remove reverse tunnel on port 27189
WARN: Could not listen on port 27189, retrying on 27190
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27183, retrying on 27184
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27184, retrying on 27185
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27185, retrying on 27186
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27186, retrying on 27187
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27187, retrying on 27188
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27188, retrying on 27189
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27189, retrying on 27190
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27190, retrying on 27191
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27191, retrying on 27192
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27192, retrying on 27193
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27193, retrying on 27194
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27194, retrying on 27195
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27195, retrying on 27196
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27196, retrying on 27197
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27197, retrying on 27198
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27198, retrying on 27199
adb.exe: error: device 'RNJK35QUAZMA' not found
ERROR: "adb forward" returned with value 1
ERROR: Could not forward any port in range 27183:27199
ERROR: Server connection failed
C:\app\editor\android\scrcpy>usb