adb 无法连接到 tcp:5037 上的守护程序

2022-09-02 05:24:56

我的 adb 无法连接设备。我正在跑步adb start-server

    ulucudeMacBook-Pro:~ ulucu$ adb start-server
    * daemon not running. starting it now at tcp:5037 *
    * daemon started successfully *

然后运行 “lsof -i tcp:5037"

    ulucudeMacBook-Pro:~ ulucu$ lsof -i tcp:5037
    COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    adb     2308 ulucu    7u  IPv4 0x440443a862048a7b      0t0  TCP localhost:5037 (LISTEN)

但是当我跑步时adb kill-server

    ulucudeMacBook-Pro:~ ulucu$ adb kill-server
    * server not running *

或运行或adb devicesadb shell

    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    adb E 03-31 09:30:26  2350 95705 usb_osx.cpp:333] Could not open interface: e00002c5
    adb E 03-31 09:30:26  2350 95705 usb_osx.cpp:294] Could not find device interface
    error: could not install *smartsocket* listener: Address already in use
    ADB server didn't ACK
    * failed to start daemon *
    error: cannot connect to daemon

adb 一直在运行。
没有其他使用“5037”端口的进程。
没有其他模拟器像“genymotion”。
我的系统是 Mac 10.12.14。
我的adb版本是1.0.39。

怎么了?


答案 1

如果您已更新到平台工具25.0.4(您可以从命令行检查正在运行的Android)并且它不起作用

只需下载以前的稳定版本,例如:https://dl.google.com/android/repository/platform-tools_r25.0.2-macosx.zip

然后转到您的Android SDK主目录,并将平台工具文件夹替换为下载的文件夹。

然后做:

ps aux | grep 5037
kill -9 <pid of process of your incorrectly running adb>

然后出发

adb devices

答案 2
adb kill-server

如果发生端口错误:

adb reconnect帮我解决


推荐