adb error,判断端口占用方法

D:\LianXi\AYKJ>netstat -nao | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2432
TCP 127.0.0.1:5037 127.0.0.1:51419 ESTABLISHED 2432
TCP 127.0.0.1:5037 127.0.0.1:51446 ESTABLISHED 2432
TCP 127.0.0.1:5037 127.0.0.1:51518 ESTABLISHED 2432
TCP 127.0.0.1:51419 127.0.0.1:5037 ESTABLISHED 6200
TCP 127.0.0.1:51446 127.0.0.1:5037 ESTABLISHED 5456
TCP 127.0.0.1:51518 127.0.0.1:5037 ESTABLISHED 6880

D:\LianXi\AYKJ>adb start-server

  • 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

D:\LianXi\AYKJ>netstat -nao | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2432

D:\LianXi\AYKJ>tasklist /fi "PID eq 2432"

映像名称 PID 会话名 会话# 内存使用
========================= ======== ================ =========== ============
adb.exe 2432 Console 1 6,812 K

D:\LianXi\AYKJ>netstat -nao | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2432

D:\LianXi\AYKJ>netstat -nao | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2432

D:\LianXi\AYKJ>netstat -nao | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 2432

根据进程id2432,找到相关进程并kill(window下进入任务管理器杀死),

你可能感兴趣的:(adb error,判断端口占用方法)