java - 守护进程未运行。现在在端口 5037 上启动它 * 无法打开 'nul' : The system cannot find the file specified

标签 java android

Eclipse 在运行 android 程序时出现以下错误...

错误一:

[2015-12-10 16:10:37 - adb] Cannot open 'nul': The system cannot find the file specified. (2)
[2015-12-10 16:10:37 - ddms] 'D:\android-sdk-windows\platform-tools\adb.exe,start-server' failed -- run manually if necessary
[2015-12-10 16:10:37 - adb] * failed to start daemon *
[2015-12-10 16:10:37 - adb] error: cannot connect to daemon

当我从命令行启动时,我得到这个错误...

错误 2:

D:\android-sdk-windows\platform-tools>adb start-server
* daemon not running. starting it now on port 5037 *
Cannot open 'nul': The system cannot find the file specified. (2)
* failed to start daemon *
error: cannot connect to daemon

以前,当我双击 AVD Manager.exeSDK manager.exe 时,它们都没有打开。在谷歌上做了 Rnd 之后,我发现了这篇文章 Android SDK manager won't open我对 android.bat 进行了如下更改:

我替换这个

rem Check we have a valid Java.exe in the path.
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

用这段代码

set java_exe=C:\Program Files\Java\jdk1.7.0_75\bin\java.exe

现在,当我双击 AVD Manager.exeSDK manager.exe 时,它打开得很好。

我还检查了新的 eclipse (Mars) 并添加了 ADT 插件并创建了 Hello World 应用程序并尝试运行但它给出了相同的错误 1

更新 2:

我遇到以下错误..

D:\>set ADB_TRACE=adb

D:\>adb start-server
adb I  6072  2636 adb.cpp:219] Android Debug Bridge version 1.0.32
adb I  6072  2636 adb.cpp:219] Revision 09a0d98bebce-android
adb I  6072  2636 adb.cpp:219]
adb I  6072  2636 adb_client.cpp:126] _adb_connect: host:version
adb I  6072  2636 sysdeps_win32.cpp:742] could not connect to tcp:5037: cannot c
onnect to 127.0.0.1:5037: No connection could be made because the target machine
 actively refused it. (10061)
adb I  6072  2636 adb_client.cpp:175] adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
Cannot open 'nul': The system cannot find the file specified. (2)
* failed to start daemon *
error: cannot connect to daemon

我检查了端口 5037 是否被其他程序使用但没有显示

netstat -aon|findstr 5037

究竟是什么错误..系统拒绝端口 5037 上的连接是什么意思如何解决它。你能帮帮我吗?

最佳答案

这是一个很晚的答案,我怀疑你差点忘了它,但它会帮助其他人面对这个问题。
由于您收到此错误:

Cannot open 'nul': The system cannot find the file specified. (2)
* failed to start daemon *
error: cannot connect to daemon

问题出在 ADB.exe 可执行文件本身,它可能已损坏或存在权限或所有权问题。

如果这只是一个权限问题,您可以通过复制(来自“D:\android-sdk-windows\platform-tools\”)来检查它:

ADB.exe
AdbWinApi.dll
AdbWinUsbApi.dll

将它粘贴到桌面的一个新文件夹中,然后在该目录中运行 adb.exe devices(按住 Shift 并右键单击目录中不在文件并在此处打开命令窗口)。
如果你看到这个,你就很好:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *

如果再次失败,那么它已经损坏,你必须替换整个 3 个文件
从这里下载 adbshell.com

关于java - 守护进程未运行。现在在端口 5037 上启动它 * 无法打开 'nul' : The system cannot find the file specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34202232/

相关文章:

java - 使用 Java 中继电子邮件

java - 典型 1 对 n 关系的 Stackoverflow 异常(递归)

android - LinearLayout children - 所有 View 都应该有相同的高度并且至少包裹它们的内容

java - Collections.synchronizedCollection 的 forEach 和 removeIf 中可能存在错误?

java - 升级后Spring Boot启动慢

java - 如何让 Java Swing 正确绘制?

java - RxJava 自上次事件以来忽略 X 时间的事件?

Android NFC 启动应用程序(使用 AAR)并读取文本

Android SSL 证书固定

android - 在 Android 中查找 View ID