Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
930 views
in Technique[技术] by (71.8m points)

android - adb cannot start daemon, CreateProcess failure, error 2

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

C:WINDOWSsystem32>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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 "%~aadb.exe" "%~aadbwinapi.dll" "%~aadbwinusbapi.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%.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...