Open bertrandgodefroy opened 1 year ago
This is potentially not the best way to fix this. Some android platforms open ports in those ranges for other things as well. E.g. the shieldtv (which is android 11 currently) opens a high number port as part of the remote control functions. It's not an adb interface. I'm not saying I know how to fix this specific issue, which definitely looks annoying, but scanning and grabbing may not solve this in all cases.
Unfortunately, when wireless adb debug is activated a random port is selected on android > version 10. Make the thing detect the port with nmap.
Example :
PHONE=192.168.19.19 adb connect ${PHONE}:$( nmap -sT ${PHONE} -p30000-49999 | awk -F/ '/tcp open/{print $1}' )
Solution from https://forum.xda-developers.com/t/adb-wifi-how-to-specify-port-and-have-it-fix.4321669/