使用adb命令连接模拟器,在5037端口未被占用情况下仍报端口错误
2014-01-05 14:37
447 查看
*转载请注明出处,勿做商业用途*
问题:
win7 64位系统使用adb命令连接模拟器,在5037端口未被占用情况下,报以下错误:
* daemon not running. starting it now on port 5037 *
CreateProcess failure, error 2
* failed to start daemon *
error: cannot connect to daemon
解决方法:
1.将本机C:\WINDOWS\System32下的adb.exe文件复制到C:\Windows\SysWOW64下。
2.将本机C:\WINDOWS\System32下的AdbWinApi.dll文件复制到C:\Windows\SysWOW64下。
解决过程:
第一步:
初一看应该是5037端口被占用了,一个比较常见的错误,于是马上执行命令查看5037端口被谁占用了:
netstat -ano | finder "5037"
但是神奇的事情发生了,结果是没有任何程序占用该端口。
第二步:
于是执行adb kill-server ,OK,再执行adb start-server,又提示相同的错误了,adb无法在5037端口启动。
第三步:
执行一下adb nodaemon server命令看看什么情况,这是一个比较有用的命令,一般情况下它会告诉我们哪里出问题了
adb nodaemon server
不幸的是仍然没有提示任何错误
第四步:
检查环境变量配置,没有错误
第五步:
基本排除adb本身的错误,开始定位CreateProcess failure, error 2 这个错误,查到了错误代码:
windows error code 2 means: 2 The system cannot find the file specified. ERROR_FILE_NOT_FOUND
and from the source code this is after a call to CreateProcess() and the file name is given by GetModuleFileName()
已经查证过不是环境配置的问题,所以定位为系统无法启动该文件。
第六步:
进入C:\WINDOWS\System32目录,检查adb相关文件。都是正确的。
第七步:
复制\System32目录下的adb.exe文件到C:\WINDOWS\SysWOW64 ,再次执行adb devices命令,提示缺失AdbWinApi.dll文件
再将\System32目录下的AdbWinApi.dll文件copy到C:\WINDOWS\SysWOW64,执行adb devices命令成功。
问题扩展:
1.32位系统
AdbWinApi.dll文件的说明如下:
If that doesn't work, you will have to extract the .dll to your system directory. By default, this is:
C:\Windows\System (Windows 95/98/Me)
C:\WINNT\System32 (Windows NT/2000)
C:\Windows\System32 (Windows XP, Vista, 7, win 8)
If you use a 64-bit version of Windows, you should also place the .dll in C:\Windows\SysWOW64\
所以32位系统应该不需要执行步骤2即可解决,有待验证。
*转载请注明出处,勿做商业用途*
问题:
win7 64位系统使用adb命令连接模拟器,在5037端口未被占用情况下,报以下错误:
* daemon not running. starting it now on port 5037 *
CreateProcess failure, error 2
* failed to start daemon *
error: cannot connect to daemon
解决方法:
1.将本机C:\WINDOWS\System32下的adb.exe文件复制到C:\Windows\SysWOW64下。
2.将本机C:\WINDOWS\System32下的AdbWinApi.dll文件复制到C:\Windows\SysWOW64下。
解决过程:
第一步:
初一看应该是5037端口被占用了,一个比较常见的错误,于是马上执行命令查看5037端口被谁占用了:
netstat -ano | finder "5037"
但是神奇的事情发生了,结果是没有任何程序占用该端口。
第二步:
于是执行adb kill-server ,OK,再执行adb start-server,又提示相同的错误了,adb无法在5037端口启动。
第三步:
执行一下adb nodaemon server命令看看什么情况,这是一个比较有用的命令,一般情况下它会告诉我们哪里出问题了
adb nodaemon server
不幸的是仍然没有提示任何错误
第四步:
检查环境变量配置,没有错误
第五步:
基本排除adb本身的错误,开始定位CreateProcess failure, error 2 这个错误,查到了错误代码:
windows error code 2 means: 2 The system cannot find the file specified. ERROR_FILE_NOT_FOUND
and from the source code this is after a call to CreateProcess() and the file name is given by GetModuleFileName()
已经查证过不是环境配置的问题,所以定位为系统无法启动该文件。
第六步:
进入C:\WINDOWS\System32目录,检查adb相关文件。都是正确的。
第七步:
复制\System32目录下的adb.exe文件到C:\WINDOWS\SysWOW64 ,再次执行adb devices命令,提示缺失AdbWinApi.dll文件
再将\System32目录下的AdbWinApi.dll文件copy到C:\WINDOWS\SysWOW64,执行adb devices命令成功。
问题扩展:
1.32位系统
AdbWinApi.dll文件的说明如下:
If that doesn't work, you will have to extract the .dll to your system directory. By default, this is:
C:\Windows\System (Windows 95/98/Me)
C:\WINNT\System32 (Windows NT/2000)
C:\Windows\System32 (Windows XP, Vista, 7, win 8)
If you use a 64-bit version of Windows, you should also place the .dll in C:\Windows\SysWOW64\
所以32位系统应该不需要执行步骤2即可解决,有待验证。
*转载请注明出处,勿做商业用途*
相关文章推荐
- 使用adb命令连接模拟器,在5037端口未被占用情况下仍报端口错误
- 使用adb命令连接模拟器,在5037端口未被占用情况下仍报端口错误【 @细数落叶】
- 使用adb命令连接模拟器,在5037端口未被占用情况下仍报端口错误
- 解决使用adb命令提示“通常每个套接字地址(协议/网络地址/端口)只允许使用一次”错误
- 解决使用adb命令提示“通常每个套接字地址(协议/网络地址/端口)只允许使用一次”错误
- windows下使用命令查看端口占用情况
- WINDOW下使用命令查看端口占用情况
- adb 连接天天模拟器端口5037被占用问题的解决
- 解决使用adb命令提示“通常每个套接字地址(协议/网络地址/端口)只允许使用一次”错误
- 使用C#调用外部Ping命令获取网络连接情况
- Android调试:真机连接不上AS(ADB端口被占用)
- Netstat -tln 命令是Linux查看端口使用情况
- Android 中查看内存的使用情况集常用adb命令
- 查看端口占用情况 (ps命令)
- android开发时解决adb端口被占用问题,adb无法连接手机
- 使用C#调用外部Ping命令获取网络连接情况!
- 使用C#调用外部Ping命令获取网络连接情况
- Centos查看端口占用情况和开启端口命令
- 在windows下查看端口占用情况的命令
- 使用netstat命令查看当前端口占用情况