android adb端口被占用解决方法

1.输入adb devices命令

C:UsersNick>adb devices
List of devices attached
adb server version (31) doesn't match this client (39); killing...
error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 (10048)

可以看出5037端口被占用了  

2. 查看端口被哪个暂用

C:UsersNick>netstat -ano | findstr "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       17276
  TCP    127.0.0.1:5037         127.0.0.1:61023        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:61028        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:61033        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:61038        TIME_WAIT       0

  

在任务管理器中查看17276的端口被那个进程暂用。结束进程。

原文地址:https://www.cnblogs.com/linlf03/p/7063268.html