daemon not running. starting it now on port 5037

来源:互联网 发布:16进制转换10进制算法 编辑:程序博客网 时间:2024/05/16 17:09

前言:今天连接了一台设备后,又 通过 adb 连接 另外一台设备(adb connect 172.16.xxx.xxx),然后点击adb shell,出现 more than one devices。然后我直接adb disconnect,再次 adb connect 172.16.xxx.xxx时,发现无反应,然后执行 adb start-server出现如下错误:

* daemon not running. starting it now on port 5037 *ADB server didn't ACK* failed to start daemon *

然后在网上找方法,试了好几种,最后发现这种靠谱,我记录下来。操作步骤如下:

1.adb nodaemon server ,出现:cannot bind ‘tcp:5037’,原因5037端口被占用。

  1. netstat -ano | findstr “5037”
TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       11516TCP    127.0.0.1:5037         127.0.0.1:49438        ESTABLISHED     11516TCP    127.0.0.1:5037         127.0.0.1:49439        ESTABLISHED     11516TCP    127.0.0.1:5037         127.0.0.1:56276        ESTABLISHED     11516TCP    127.0.0.1:49438        127.0.0.1:5037         ESTABLISHED     4696TCP    127.0.0.1:49439        127.0.0.1:5037         ESTABLISHED     7740TCP    127.0.0.1:56276        127.0.0.1:5037         ESTABLISHED     4696

找到“11516”,然后查找“11516”对应的是哪个进程

  1. tasklist | findstr “11516”
    adb.exe 11516 Console 1 7,472 K

发现是 adb服务占用了 5037这个端口,接下来有2中方法,一种是在任务管理器中将 adb.exe服务杀死,另一种是通过 tasklist 来找到adb.exe服务的pid即进程id,然后执行taskkill /f /pid xxx来杀死该进程(你得有权限)。

1 0