Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 54:48:45 |
Calls: | 422 |
Files: | 1,025 |
Messages: | 90,671 |
Do you use ADB (or ScreenCopy) with Android & Windows?
If so, let me know so that I can ask you a question.
Just ask your question. If anyone can answer it, they will answer.
Do you use ADB (or ScreenCopy) with Android & Windows?
If so, let me know so that I can ask you a question.
So here are my questions which only someone using adb can answer.
Q1: What port doesyour Windows adb use?
Q2: Where is that port set inside of the adb tool?
where there's no sense asking the question of people who
have never used adb because they can't possibly guess at the answer I seek.
There's nothing special about adb or stunnel, they're just programs that
want to listen on TCP ports, if something else already has that port
open, they will fail, it may be unexpected that hyper-v has laid claim
to blocks of ports, is all.
So here are my questions which only someone using adb can answer.
Q1: What port doesyour Windows adb use?
5037
Q2: Where is that port set inside of the adb tool?
It's the default baked-into adb.exe
netstat -ano | findstr "5037"
adb --versionAndroid Debug Bridge version 1.0.41
I forgot how I did it though... looking it upo... as we speak...
set ANDROID_ADB_SERVER_PORT=cannot connect to daemon at tcp:5037:
adb kill-server
adb devices* daemon not running; starting now at tcp:5037
Q2: Where is that port set inside of the adb tool?
C:\> set | findstr /i adb
ANDROID_ADB_SERVER_PORT=55555
Marion wrote:
where there's no sense asking the question of people who
have never used adb because they can't possibly guess at the answer I seek.
There's nothing special about adb or stunnel, they're just programs that
want to listen on TCP ports, if something else already has that port
open, they will fail, it may be unexpected that hyper-v has laid claim
to blocks of ports, is all.
When I run this, it finds nothing even when adb is connected to Android.
C:\> netstat -ano | findstr "5037"
But when I run this, it finds the adb connection.
netstat -ano | findstr "55555"
where there's no sense asking the question of people who
have never used adb because they can't possibly guess at the answer I seek.
If it's above 1023, you should reserve the port using:
C:\> netsh int ipv4 add excludedportrange protocol=tcp startport=55555 numberofports=1
Or am I missing something?
If it's above 1023, you should reserve the port using:
C:\> netsh int ipv4 add excludedportrange protocol=tcp startport=55555 numberofports=1
And presumably you could check the exitcode of the netsh command, and if
it fail increment the port number and retry, finally setting the
environment variable to the actual port number?
y'mean some4thing like this?
Arlen' could just use 'netstat' and see for
himself. Or am I missing something?
Frank Slootweg wrote:
Arlen' could just use 'netstat' and see for
himself. Or am I missing something?
Not every port that shows up with netsh also shows with netstat, e.g.
C:\Users\AndyC:\Users\Andy>netsh interface ipv4 show excludedportrange protocol=tcp | find /i "50060"
50060 50159
C:\Users\Andy>netstat -an | find ":50060"
[nothing]
On 9 May 2025 10:12:02 GMT, Frank Slootweg wrote :
Or am I missing something?
Frank,
Sometimes you act like an actual adult & sometimes you're just an asshole. This time, you are missing so much, it would take me weeks to clue you in.
So stop it with your childish crap based on ignorance of the situation.
You know absolutely nothing if you think a netstat solves the issue.
It's demeaning for me to even have to explain this to you, Frank.
But is (adb port) 5037 in the excluded port range? On my system,
netstat diplays for example port 5354, which is somewhat close.
Frank Slootweg wrote:
But is (adb port) 5037 in the excluded port range? On my system,
netstat diplays for example port 5354, which is somewhat close.
If (and I'll take Arlen at his word) Hyper-V decides to pick multiple
blocks of multiple addresses at each boot, then it could get clobbered
some of the time ...
But is (adb port) 5037 in the excluded port range? On my system,
netstat diplays for example port 5354, which is somewhat close.
If (and I'll take Arlen at his word) Hyper-V decides to pick multiple
blocks of multiple addresses at each boot, then it could get clobbered
some of the time
netsh int ipv4 add excludedportrange tcp %port% 1 >nul 2>&1
if %errorlevel% == 0 (
set reserved_port=%port%
echo Successfully reserved TCP port %reserved_port%
netsh interface ipv4 show excludedportrange protocol=tcpIf you've enabled Hyper-V, you'll see excluded ports being random!
net stop winnat
netsh interface ipv4 show excludedportrange protocol=tcp
net start winnat
netsh interface ipv4 show excludedportrange protocol=tcp
netstat -ano | findstr :55555(finds nothing is binding to the port)
netsh interface ipv4 show tcpconnections
ncat -l -p 55555 (or... ncat -l -k -p 55555 -e exit)Ncat: bind to :::55555: An attempt was made to access a socket
netsh interface ipv4 show excludedportrange protocol=tcp(shows the port is excluded)
And, as I showed, he didn't have to ask anybody, because the answer in
in plain sight in Google.
"Note: All adb clients use port 5037 to communicate with the adb server.
The server then sets up connections to all running devices. It locates
emulators by scanning odd-numbered ports in the range 5555 to 5585,
which is the range used by the first 16 emulators."
From:
'How adb works' <https://developer.android.com/tools/adb#:~:text=Note%3A%20All%20adb%20clients%20use,by%20the%20first%2016%20emulators.>
set ANDROID_ADB_SERVER_PORT=
adb devices* daemon not running; starting now at tcp:5037