当前位置: 首页 > 工具软件 > smart-socket > 使用案例 >

adb shell提示error: could not install *smartsocket* listener

蒋永宁
2023-12-01

执行adb shell命令遇到错误提示:

C:\Users\tester>adb shell ps|grep demo
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\tester>netstat -aon|findstr "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       5148
  TCP    127.0.0.1:5037         127.0.0.1:54801        ESTABLISHED     5148
  TCP    127.0.0.1:5037         127.0.0.1:54931        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:54975        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:54992        TIME_WAIT       0
  TCP    127.0.0.1:51966        127.0.0.1:5037         TIME_WAIT       0
  TCP    127.0.0.1:51967        127.0.0.1:5037         TIME_WAIT       0
  TCP    127.0.0.1:51968        127.0.0.1:5037         TIME_WAIT       0
  TCP    127.0.0.1:51969        127.0.0.1:5037         TIME_WAIT       0

找到了5037端口占用的PID “5148”,再执行命令:

C:\Users\tester>tasklist|findstr "5148"
360MobileLink.exe             5148 Console                    1     24,424 K

找到罪魁祸首了,kill它就可以了。

注意可能需要重新授权,不然会提示:

C:\Users\tester>adb shell ps|grep demo
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.



 类似资料: