解决5037端口占用的方法

1.cmd窗口 输入命令 netsta -ano|findstr "5037" 回车记住 占用此端口的应用PID,如图中圈出的数字18232


2.然后输入命令 tasklist|findstr "PID" 查看占用该端口的应用程序  

或者是进入到任务管理器查看占用程序

找到该应用程序之后 结束进程就可以了 

或者输入命令  taskkill /f /t /im xxx.exe

@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!
echo ---------------------------
pause

exit

:ReleasePort
TASKKILL /f /PID %1

将上面的代码保存到一个bat文件运行即可

原文地址:https://www.cnblogs.com/handaxing/p/7017776.html