Re: Do you use ADB (or ScreenCopy) with Android & Windows?

Liste des GroupesRevenir à cm android 
Sujet : Re: Do you use ADB (or ScreenCopy) with Android & Windows?
De : marion (at) *nospam* facts.com (Marion)
Groupes : comp.mobile.android
Date : 09. May 2025, 11:21:08
Autres entêtes
Organisation : BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID : <vvkkuk$ni4$1@nnrp.usenet.blueworldhosting.com>
References : 1 2 3 4 5 6 7
User-Agent : MacSOUP/2.8.5 (ea919cf118) (Mac OS 10.12.6)
On Fri, 9 May 2025 11:12:54 +0100, Andy Burns wrote :


     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?

 @echo off
 setlocal
 
 set "targetPort=55555"
 set "maxRetries=10"
 set "retryCount=0"
 
 :reservePort
 echo Trying to reserve port %targetPort%...
 netsh int ipv4 add excludedportrange protocol=tcp startport=%targetPort% numberofports=1
 
 if errorlevel 1 (
     echo Failed to reserve port %targetPort%. Error code: %errorlevel%
     set /a retryCount+=1
     if %retryCount% lss %maxRetries% (
         set /a targetPort+=1
         echo Retrying with port %targetPort%...
         goto :reservePort
     ) else (
         echo Failed to reserve a port after %maxRetries% retries. Exiting.
         goto :end
     )
 ) else (
     echo Successfully reserved port %targetPort%.
     echo Setting ANDROID_ADB_SERVER_PORT environment variable to %targetPort%
     setx ANDROID_ADB_SERVER_PORT %targetPort% /M
     echo Please note that system environment variables changes may require a reboot to fully take effect for all processes.
     goto :end
 )
 
 :end
 endlocal
 pause

Date Sujet#  Auteur
5 May 25 * Do you use ADB (or ScreenCopy) with Android & Windows?24Marion
9 May 25 `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?23Arno Welzel
9 May 25  `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?22Marion
9 May 25   +* Re: Do you use ADB (or ScreenCopy) with Android & Windows?9Andy Burns
9 May 25   i`* Re: Do you use ADB (or ScreenCopy) with Android & Windows?8Marion
9 May 25   i +* Re: Do you use ADB (or ScreenCopy) with Android & Windows?6Marion
9 May 25   i i+- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion
9 May 25   i i`* Re: Do you use ADB (or ScreenCopy) with Android & Windows?4Andy Burns
9 May 25   i i `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?3Marion
9 May 25   i i  `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?2Andy Burns
9 May 25   i i   `- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion
9 May 25   i `- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Andy Burns
9 May 25   `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?12Andy Burns
9 May 25    +- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion
9 May 25    `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?10Frank Slootweg
9 May 25     +* Re: Do you use ADB (or ScreenCopy) with Android & Windows?3Marion
9 May 25     i`* Re: Do you use ADB (or ScreenCopy) with Android & Windows?2Frank Slootweg
9 May 25     i `- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion
9 May 25     `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?6Andy Burns
9 May 25      `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?5Frank Slootweg
9 May 25       `* Re: Do you use ADB (or ScreenCopy) with Android & Windows?4Andy Burns
9 May 25        +* Re: Do you use ADB (or ScreenCopy) with Android & Windows?2Frank Slootweg
9 May 25        i`- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion
9 May 25        `- Re: Do you use ADB (or ScreenCopy) with Android & Windows?1Marion

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal