1、报错信息
D:\AndroidStudio\sdk\platform-tools>adb connect 192.168.53.54:5555
connected to 192.168.53.54:5555
D:\AndroidStudio\sdk\platform-tools>adb devices
adb.exe: unknown command divices
2、查看占用的端口号
D:\AndroidStudio\sdk\platform-tools>adb nodaemon server
adb F 07-16 10:35:48 16568 11228 main.cpp:144] could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 閫氬父姣忎釜濂楁帴瀛楀湴鍧€(鍗忚
/缃戠粶鍦板潃/绔彛)鍙厑璁镐娇鐢ㄤ竴娆°€?(10048)
3、根据端口号查看进程
D:\AndroidStudio\sdk\platform-tools>netstat -ano | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 15064
TCP 127.0.0.1:5037 127.0.0.1:58201 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:58202 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:58210 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:58211 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:59052 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:59054 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:59055 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:59056 ESTABLISHED 15064
TCP 127.0.0.1:5037 127.0.0.1:59057 ESTABLISHED 15064
4、终止占用的进程
D:\AndroidStudio\sdk\platform-tools>tasklist | findstr "15064"
adb.exe 15064 Console 2 9,604 K
D:\AndroidStudio\sdk\platform-tools>taskkill /f /pid 15064
成功: 已终止 PID 为 15064 的进程。
5、再次连接
D:\AndroidStudio\sdk\platform-tools>adb connect 192.168.53.54:5555
connected to 192.168.53.54:5555
D:\AndroidStudio\sdk\platform-tools>adb devices
List of devices attached
192.168.53.54:5555 device