android studio adb 错误问题

@echo off 
color a
title ReleaseAdbPort
echo Checking adb port...
for /F "usebackq tokens=5" %%a in (`"netstat -ano | findstr "5037""`) do (   
if not "%%a" =="0" call :ReleasePort %%a
)
echo ---------------------------
echo adb port has been released!
C:\Users\YOUR_NAME\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server
echo ---------------------------

exit

:ReleasePort
TASKKILL /f /PID %1

@ping 127.0.0.1 -n 3 >nul

@echo off 
color a
title ReleaseAdbPort
echo Checking adb port...
for /F "usebackq tokens=5" %%a in (`"netstat -ano | findstr "5037""`) do (   
if not "%%a" =="0" call :ReleasePort %%a
)
echo ---------------------------
echo adb port has been released!
C:\Users\YOUR_NAME\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server
echo ---------------------------

exit

:ReleasePort
TASKKILL /f /PID %1
C:\Users\YOUR_NAME\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server

猜你喜欢

转载自blog.csdn.net/kejia90/article/details/122819551