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

tea*_*too 6 java android google-maps adb

我的adb无法连接设备.我运行" adb start-server "

ulucudeMacBook-Pro:~ ulucu$ adb start-server
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
Run Code Online (Sandbox Code Playgroud)

然后运行" 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)
Run Code Online (Sandbox Code Playgroud)

但是当我运行" adb kill-server "时

ulucudeMacBook-Pro:~ ulucu$ adb kill-server
* server not running *
Run Code Online (Sandbox Code Playgroud)

或运行" adb devices "或" adb 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
Run Code Online (Sandbox Code Playgroud)

adb一直在运行,没有其他进程使用"5037"端口,没有其他模拟器如"genymotion"我的系统是Mac 10.12.14,我的adb版本是1.0.39.

有什么问题?

Aca*_*tta 14

adb kill-server
Run Code Online (Sandbox Code Playgroud)

如果发生端口错误:

adb reconnect 帮我解决


小智 10

如果您已更新到Platform Tools 25.0.4(您可以检查从命令行运行android),它就无法正常工作

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

然后转到Android SDK主目录并将platform-tools文件夹替换为下载的文件夹.

然后做:

ps aux | grep 5037
kill -9 <pid of process of your incorrectly running adb>
Run Code Online (Sandbox Code Playgroud)

adb devices
Run Code Online (Sandbox Code Playgroud)


abi*_*ita 8

根据该线程,您无法连接,因为该地址已被使用。您可以尝试busybox netstat -antp检查谁正在使用该端口。这是另一个可能有帮助的解决方法:

MacBook首先运行以下命令来列出正在使用端口的进程来解决此问题5037

lsof -n -i4TCP:5037 | grep LISTEN
Run Code Online (Sandbox Code Playgroud)

然后,我杀了它:

kill -9 <PID>
Run Code Online (Sandbox Code Playgroud)

然后,adb devices工作了!

希望这可以帮助!