• What is an adb "reverse tunnel" when connecting Windows to Android over

    From Andrew@21:1/5 to All on Mon Sep 23 16:13:55 2024
    XPost: comp.mobile.android, alt.comp.os.windows-11

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew@21:1/5 to Andrew on Mon Sep 23 16:50:53 2024
    XPost: comp.mobile.android, alt.comp.os.windows-11

    Andrew wrote on Mon, 23 Sep 2024 16:13:55 -0000 (UTC) :

    C:\app\editor\android\scrcpy>usb
    scrcpy 1.24 <https://github.com/Genymobile/scrcpy>

    I just realized people won't know what the "usb" command is, which is
    called "usb.bat" as there is also a "wifi.bat" command for the LAN.

    The usb.bat command is simply a script kindly written by Herbert Kleebauer which contains some "showwin" magic to hide the screen-copy console.

    All it does is run one line, where the rest is to hide the console.

    :r C:\app\editor\android\scrcpy\usb.bat

    @echo off

    REM: Download screencopy onto your PC <https://scrcpy.org/>
    REM: Set Android "Developer Options" "USB debugging = On"
    REM: Then plug the Android phone into the USB port of Windows
    REM Then run "scrcpy -s RNJK35QUAZMA" on the Win/Mac/Linux PC
    REM: This will mirror Android onto your Win/Mac/Linux PC
    REM: But scrcpy leaves an annoying console behind, by default

    REM: The entire point of this script is to run that one command
    REM: But WITHOUT leaving an empty console behind on Windows.

    :: Mirror Android onto Windows w/o leaving a console window behind
    cd /d "c:\app\editor\android\scrcpy"
    certutil -f -decode %~f0 showwin.exe>nul

    :: now we hide console window
    showwin.exe 0

    :: Change this line below to the unique serial number of your phone
    scrcpy -s RNJK35QUAZMA

    :: after scrcpy is closed we show console window again
    showwin.exe 5

    del showwin.exe
    goto :eof

    REM I have absolutely no idea what the stuff below actually does.

    -----BEGIN CERTIFICATE-----
    TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
    b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl
    cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
    AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA
    ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
    GBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAYAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAmAQAAABAAAAACAAAAAgAA
    AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoEAAAAAAAAJQQAACmEAAA
    uhAAAAAAAABgEAAAAAAAAAAAAABUEAAAABAAAIQQAAAAAAAAAAAAAHYQAAAIEAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAABVU0VSMzIuZGxsAABoEAAAAAAAAAAAU2hvd1dp
    bmRvdwAAS0VSTkVMMzIuZGxsAACUEAAAphAAALoQAAAAAAAAAABHZXRDb21tYW5k
    TGluZUEAAABHZXRDb25zb2xlV2luZG93AAAAAEV4aXRQcm9jZXNzAP8VCBBAADHS
    SECAOAB0EYA4InUC99IJ0nXvgDggdepAMfa9BQAAAA+2EEAI0nQTgOowcvOA+gl3
    7mv2CgHWMe3r5QntdAKJ7v8VDBBAAFZQ/xUAEEAAagD/FRAQQAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)