【安卓]adb 5037端口被占用问题(adb server is out of date. killing...)
在执行adb devices时发现端口被占用C:\Users\Administrator>adb devices
* daemon not running; starting now at tcp:5037
1.尝试重启adb服务
C:\Users\Administrator>adb kill-server
C:\Users\Administrator>adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
2.如果无效,尝试查找占用5037的程序有哪些,执行netstat -aon|findstr "5037"
:\Users\Administrator>netstat -aon|findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 960
TCP 127.0.0.1:5037 127.0.0.1:51392 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:51400 TIME_WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:51401 TIME_WAIT 0
如例,查询960是哪个程序占用的,执行 tasklist|findstr "960",发现有四个程序,只终止adb.exe没用,这四个必须都杀死才可以
C:\Users\Administrator>tasklist|findstr "960"
svchost.exe 1368 Services 0 1,960 K
svchost.exe 2960 Services 0 1,796 K
chrome.exe 7960 Console 1 28,664 K
adb.exe 960 Console 1 11,516 K
依次执行 taskkill /f /t /im XXX.exe
C:\Users\Administrator>taskkill /f /t /im adb.exe
成功: 已终止 PID 960 (属于 PID 10020 子进程)的进程。
再重新连接,查看连接adb一般就好了
C:\Users\Administrator>adb devices
List of devices attached
127.0.0.1:62001 device
当然,最省事的方法就是重启电脑
页:
[1]