【问题标题】:Daemon not running. starting it now on port 5037 * Cannot open 'nul': The system cannot find the file specified守护程序未运行。现在在端口 5037 上启动它 * 无法打开“nul”:系统找不到指定的文件
【发布时间】:2015-12-10 12:44:20
【问题描述】:

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

错误 1:

[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 这意味着如何解决它。你能帮帮我吗?

【问题讨论】:

    标签: java android


    【解决方案1】:

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

    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 并右键单击目录中不在文件中的任意位置并在此处打开命令窗口 em>)。
    如果你看到这个你很好:

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

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

    【讨论】:

      猜你喜欢
      • 2014-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多