启动adb 报错:
C:\Users\Administrator>adb devices
List of devices attached
* daemon not running. starting it now at tcp:5037 *
error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037:
通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 (10048)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
解决办法:
C:\Users\Administrator>netstat -ano | findstr "5037" //查询5037端口占用的进程
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3820
C:\Users\Administrator>tasklist | findstr 3820 //从进程号查找出进程的具体信息,在控制台将其kill掉
tadb.exe 3820 Console 1 7,208 K
C:\Users\Administrator>adb devices
List of devices attached
adb server version (31) doesn't match this client (39); killing...
error: protocol fault (couldn't read status): Connection reset by peer
* daemon started successfully *
A10ABMKSJTUK device
端口被占用,查进程,杀进程:
- 根据端口号查进程号:netstat -ano | findstr 端口号
- 根据进程号查程序名字:tasklist | findstr 进程号
- 强制、递归 删除本程序及其子进程:taskkill -f -t -im 文件名