守护程序未运行.现在在端口5037上启动它*无法打开'nul':系统找不到指定的文件 [英] Daemon not running. starting it now on port 5037 * Cannot open 'nul': The system cannot find the file specified

查看:270
本文介绍了守护程序未运行.现在在端口5037上启动它*无法打开'nul':系统找不到指定的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Eclipse gives following error while running android program...

错误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

当我从命令行启动时,出现此错误...

And when I start from command line I get this error...

错误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.exe SDK manager.exe 都没有打开.在Google上进行Rnd后,我发现此信息 Android SDK管理器无法打开,并且我对android.bat进行了如下更改:

Previously even AVD Manager.exe and SDK manager.exe was not opening when I double click on it. After doing Rnd on google I found this post Android SDK manager won't open and I made changes to android.bat as follow :

我替换了

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.exe SDK manager.exe 时,它会很好地打开.

Now when I double click on AVD Manager.exe and SDK manager.exe it opens well.

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

I also checked with new eclipse (Mars) and added ADT plug in and created Hello World Application and tried to run but its gives same Error 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是否被其他程序使用,但未显示

I checked whether port 5037 is used by other program but it is not showing

netstat -aon|findstr 5037

确切的错误是什么..system拒绝了端口5037的连接,这意味着如何解决它.你能帮我吗?

What is error exactly..system refused connection on port 5037 what does it mean how to resolve it. Can you please help me?

推荐答案

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

This is pretty late answer, I doubt you nearly forgot about it, but it would help other people facing this issue.
Since you got this error :

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

问题出在 ADB.exe 可执行文件中,该可执行文件本身可能已损坏,或者具有权限或所有权问题.

The problem is in the ADB.exe executable it self which may be corrupted or having permission or ownership issue.

如果只是权限问题,可以通过复制(从"D:\ android-sdk-windows \ platform-tools \" )进行检查:

If it is just a permission problem you can check it by copying (from "D:\android-sdk-windows\platform-tools\") :

ADB.exe
AdbWinApi.dll
AdbWinUsbApi.dll

将其粘贴到桌面的新文件夹中,然后在该目录(按住 Shift 并在目录中不位于该目录的任何位置上单击鼠标右键)中运行 adb.exe设备文件并在此处打开命令窗口).
如果您看到这个,那您很好:

past it in a new folder in your desktop and run adb.exe devices in that directory (hold Shift and right click anywhere in the directory not in files and open command window here).
if you see this you are good:

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

如果再次失败,则说明它已损坏,您必须替换整个3个文件
从此处 adbshel​​l.com

if it failed again ,then it is corrupted and you have to replace the whole 3 files
download them from here adbshell.com

这篇关于守护程序未运行.现在在端口5037上启动它*无法打开'nul':系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆