Re: What is using Android adb port 55555 and/or 5555 on Windows

Andrew <[email protected]> Sun, 21 Jul 2024 13:06:23 -0000 (UTC)
Newsgroups comp.mobile.android,alt.comp.os.windows-10,alt.comp.networking.connectivity
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <[email protected]>
Arno Welzel wrote on Sun, 21 Jul 2024 13:39:04 +0200 :

>> Background:
>> 1. I boot up the PC & I use adb every day, all day, while I'm at home.
>> 2. My phone is always connected by USB or Wi-Fi over adb on Windows 10.
>> 3. Mostly I use adb to mirror Android onto Windows when I'm at my desk.
> 
> Depending in your Windows version, you may use netstat in an
> administrative Windows console:
> 
> netstat -anb
> 
> This will show all open ports and the name of the process which opened
> it. The options used:
> 
> a - all ports, including the ones which are listening for incoming
> connections
> 
> n - do not try to resolve names for IP addresses
> 
> b - show the name of the process which opened the port

Thanks Arno for your kind suggestion, which I've added to my syslog.
 Win+R > syslog [Enter] <== syslog is in the AppPaths registry key

I've since rebooted, so whatever was holding on to 55555 has released.
Rebooting almost always, if not always works - which is why it's odd.

I ran the command without adb connections:
1. Win+R > netstat -anb [Ctrl+Shift+Enter] <== to open an admin window
2. netstat -anb | findstr 5555
3. Which reported:
    TCP 127.0.0.1:55555 0.0.0.0:0 LISTENING

I ran the command with the phone connected by adb over USB:
 C:\app\editor\android\scrcpy> scrcpy -s 192.168.1.4 <== mirrors Android
 C:\app\editor\android\sndcpy <== this uses the PC's speakers instead
   Waiting for device...
   Performing Streamed Install
   Success
   32961
   Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.rom1v.sndcpy/.MainActivity }
   Waiting for 0 seconds, press a key to continue ...
   Playing audio...
 C:\Windows\system32> netstat -anb | findstr 5555
    TCP    127.0.0.1:11023        127.0.0.1:55555        ESTABLISHED
    TCP    127.0.0.1:55555        0.0.0.0:0              LISTENING
    TCP    127.0.0.1:55555        127.0.0.1:11012        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11013        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11014        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11015        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11016        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11017        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11019        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11020        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11021        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11022        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11023        ESTABLISHED
    TCP    127.0.0.1:55555        127.0.0.1:11027        TIME_WAIT
    TCP    127.0.0.1:55555        127.0.0.1:11028        TIME_WAIT

And I ran the command with the phone connected by adb over Wi-Fi
(using the Wireless Debugging Tile that came with Android 10+)
 C:\app\editor\android\scrcpy> adb connect 192.168.1.4:42643
  connected to 192.168.1.4:42643
C:\app\editor\android\scrcpy> scrcpy -s 192.168.1.4
   scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
   C:\app\editor\android\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 25.0 MB/s (41159 bytes in 0.002s)
   [server] INFO: Device: samsung SM-A326U (Android 13)
   INFO: Renderer: direct3d
   INFO: Initial texture: 720x1600
 C:\Windows\system32> netstat -anb | findstr 5555
 C:\Windows\system32> netstat -anb | findstr 5555
    TCP 127.0.0.1:55555 0.0.0.0:0  LISTENING
    TCP 127.0.0.1:55555 127.0.0.1:63998 ESTABLISHED
    TCP 127.0.0.1:63998 127.0.0.1:55555 ESTABLISHED

The next time I get this adb error, I'll run that netstat command
as none of the commands above showed what it shows when adb is locked.
    PORT      STATE  SERVICE REASON
    55555/tcp closed unknown reset ttl 64

Much appreciated the kind help & advice even though I have no idea why the
netstat command is showing all those ports when I didn't open them myself.