adb cannot start daemon, CreateProcess failure, er

2019-01-07 01:13发布

I an unable to run adb root or any adb command. I get the following error. I set ADB_TRACE=1:

C:\WINDOWS\system32>adb root
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: could not connect
to tcp:5037
system/core/adb/adb_client.c::adb_connect():adb_connect: service root:
* daemon not running. starting it now on port 5037 *
CreateProcess failure, error 2
* failed to start daemon *
error: cannot connect to daemon

I am using Windows 7.

From netstat -a I don't see anything else using port 5037. When I run adb, I observe that adb momentarily is displayed on Task Manager, but then it goes away. Windows Firewall is turned off. I get the same results if I run cmd as administrator.

标签: android adb
6条回答
虎瘦雄心在
2楼-- · 2019-01-07 01:15

You need to make sure that all your development tools use the same version of adb.

One easy way to do that is to open the Command Prompt window as Administrator and run these 2 commands to delete all copies:

taskkill /f /im adb.exe
for %a in ("%systemroot%" "%userprofile%" "%path:;=";"%") do @del /q /f /s "%~a\adb.exe" "%~a\adbwinapi.dll" "%~a\adbwinusbapi.dll" 2>nul

Then reinstall the latest version of the platform-tools package from the SDK Manager or manually by downloading and unzipping the package file (check adb info page for the link) into the %ANDROID_SDK_HOME% folder.

Also make sure that %ANDROID_SDK_HOME%\platform-tools folder is included in your %PATH%.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-07 01:26

I faced the same issue, to solve it, I have uninstalled the package Platform-tools on the SDK manager -> SDK tools and re-installed it. Now, It's working correctly.

查看更多
淡お忘
4楼-- · 2019-01-07 01:27

I got the same problem, BTW I am using win7 64bit.

solved it like this: Move the adb.exe and adbwinapi.dll to X:\Windows\SysWOW64

hope useful

查看更多
戒情不戒烟
5楼-- · 2019-01-07 01:30

I solved this problem long ago, but did not update this question.

I was having this issue because I was running the incorrect adb executable. I had one executable in C:\Windows\system32 and another in a different directory. The version in C:\Windows\system32 had did not have all the files needed by adb whereas the version in the other directory did. I'm not sure what those files were, but the adb executable was the same version in both directories. Since C:Windows\system32 was in the PATH first, that version was executed first. I removed adb from the Windows directory, and the problem went away.

查看更多
太酷不给撩
6楼-- · 2019-01-07 01:30

You can try this solution: Move the adb.exe and adbwinapi.dll to X:\Windows\system

It worked for me

查看更多
叛逆
7楼-- · 2019-01-07 01:36

I solved this by going to the actual platform-tools directory.

Default path is C:\Users[youruser]\AppData\Local\Android\sdk\platform-tools

Apparently it won't start unless you change to that directory.

查看更多
登录 后发表回答