【发布时间】:2021-11-08 02:02:15
【问题描述】:
我已经使用 AS 几个月了,但是两天后我在尝试运行我的应用时遇到错误:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
我读过很多人遇到这个问题,但提供的解决方案对我不起作用。我特别阅读了这些问题:
- Daemon not running. Starting it now on port 5037
- Android ADB - Daemon still not running
- How to resolve the "ADB server didn't ACK" error?
- Eclipse error "ADB server didn't ACK, failed to start daemon"
- Adb won't start
- How to resolve the "ADB server didn't ACK" error?
- Daemon not running. starting it now on port 5037 * Cannot open 'nul': The system cannot find the file specified
这些问题的很多答案都说要从任务管理器关闭 adb.exe,问题是 adb.exe 没有运行,如果我尝试通过在 PowerShell 窗口上键入 .\adb start-server 重新启动它,我会得到相同的结果错误。
我也尝试重新启动我的电脑,但没有成功。 在我尝试连接的 Android 设备(三星 Galaxy S8)上,我启用了 USB 调试。我什至尝试删除所有授权设备,但没有任何效果。
我检查了 5037 端口是否被其他进程使用,但它被 adb.exe 使用(并且该端口上的防火墙状态是允许且不受限制的)。顺便说一句,正如我所说,在任务管理器中 adb.exe 不存在。
最后我尝试按照我链接的最后一个问题中提供的说明进行操作(基本上我重新下载了 adb.exe)。
最初我跑了.\adb start-server,然后出现了这个奇怪的错误:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
** daemon still not running
error: cannot connect to daemon
然后当我尝试在 Android Studio 上运行我的应用程序时,它会在尝试启动 adb 时出现这个新错误:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
ADB server didn't ACK
* failed to start daemon *
然后如果我尝试.\adb kill-server 然后.\adb start-server 或.\adb devices 或.\adb usb 再次发生相同的错误。
此外,当我现在连接我的设备时,它会要求我授权我的电脑进行连接。
我不知道这是否有帮助,但最近我停用了很多 Windows 服务(但我认为我没有停用与 Android Studio 相关的东西)。
详情
- PC:康柏
- PC 操作系统:Windows 10 家庭版
- 设备:三星 Galaxy S8 (Exynos)
- 设备操作系统:Android 8.0
- AS 版本:3.0.1
【问题讨论】:
-
你授权USB调试了吗??
-
@MartinZeitler 是的
-
我怀疑它已经运行了,可能是因为安装了 Genemotion
stop-server&start-server普通帮助;还要确保没有本地防火墙阻止默认端口tcp:5555。 -
Start > All Programs > Accessories > System Tools > Resource Monitor > Network > Listening Ports可用于查看端口是否已被任何其他应用程序使用。 -
@MartinZeitler 我不使用 Genymotion(我的旧电脑不支持模拟器 :( )。为什么端口 5555 很重要?不是 adb 使用 5037 吗?
标签: android android-studio adb