ChatGPT解决这个技术问题 Extra ChatGPT

Eclipse error "ADB server didn't ACK, failed to start daemon"

After updating the SDK, Eclipse shows this error:

ADB server didn't ACK, failed to start daemon.

When I run an Android application, it gives me the following:

Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-tools\adb.exe' and can be executed.

How can I fix this problem?

just recently installed the genymotion and after that it started happening the solution was to remove the adb command from terminal manually and setting the adb path in environment variables in ubantu pointing to sdk/platform-tools and then it worked.

S
Sameer

Thanks, @jowett, I have solved my same problem, doing these steps

Step 1: CTRL+Shift+Esc to open the task manager, which has adb.exe process and end (kill) that process

Step 2: Now, close the eclipse, which is currently running on my computer.

Step 3: Again, restart eclipse then solved that problem.

For those using OS X

killall adb

For those using Windows

adb kill-server

should do the trick.


Ubantu: Every time I kill-server, it starts itself on same port, and the error persists. Emulator never starts. I checked using sudo lsof -i , there is a new pid for adb each time you kill server. Adb never starts (it started itself), start-server is therefore becoming unnecessary.
S
Stephane Rolland

I met same problem, though I didn't what caused this. Whatever, i find some clues and fixed finally.

When I open SDK and AVD manager, but find the AVD version(2.3.3) is not same with android lib version(2.3). So I create a new AVD with 2.3.

I fixed it by the following steps: 1. Open windows task manager and kill adb.exe process. 2. Close eclipse and restart it. Then it works.

Hope it helps.


P
Peter Mortensen

Command prompt (cmd.exe):

netstat -aon | findstr 5037

Find the process id of 0.0.0.0:

https://i.stack.imgur.com/LG1Yo.png

Make sure it's adb.exe:

tasklist | findstr 1980

https://i.stack.imgur.com/tVb9C.png

Kill this process:

taskkill /f /t /im adb.exe

https://i.stack.imgur.com/lyKoR.png

Get ADB back to normal:

https://i.stack.imgur.com/Ghpis.png

Credit: blog post *Android ADB server didn't ACK failed to start daemon*


My side is tfadb.exe, after kill it, it's working, thank you.
In my case, svchost.exe was using the port. After killing it, it started successfully.
R
Raffael

These symptoms occur if you are using the Genymotion emulator (on Windows or Linux) at the same time as Android Studio:

adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *

Genymotion includes its own copy of adb, which interferes with the one bundled in the Android SDK.

The easiest way to fix seems to be to update your Genymotion Settings so it uses the same ADB as your Android SDK:

https://i.stack.imgur.com/kmx1n.png

Just check the "Use custom Android SDK tools" option and enter your desired location.


Works for me after updating Android Studio to 2.1.2.
P
Peter Mortensen

ADB will often fail if there is a newline in adb_usb.ini. Remove it, restart it, and that will often solve the problem (at least for me anyway).


while trying to debug with Kindle Fire wanted to make an entry in this file ~/.android/adb_usb.ini, but unknowingly added few extra blank lines. Now removed it. got fixed, thanks.
P
Peter Mortensen

If you are using a sync application for the device, it could also be because there are other apps using the same 5037 port. Shut down all services running on port 5037 and try starting ADB.

To check if any application is using port 5037, use this:

netstat -a -n -o |findstr "5037"

Get the PID of the application.

Use Process Explorer to find the Process and exit it.

Now use adb start-server or adb get-state to start/check the ADB server status.

I faced the issue when I used the Snappea / Wandoujia Sync application.


Thanks! svchost.exe was using that port for some reason suddenly.
I do not know when will this be fixed but it is a shame not to be fixed still.
n
nmr

I caused this problem by entering an extra blank line at the end of ~/.android/adb_usb.ini

(Removing the extra blank line fixed the problem)


Have fix similar problem by removing all blank lines, not just last one.
I had the same problem because I added one blank line at the end when entering the Kindle Fire lines. I removed the blank line and adb restarted without issue. Thanks.
P
Peter Mortensen

We can solve this issue so easily.

Open a command prompt, and do cd Run command adb kill-server Open Windows Task manager and check whether adb is still running. If it is, just kill adb.exe Run command adb start-server in the command prompt

https://i.stack.imgur.com/3IsxM.jpg


No need to restart Eclipse! :)
P
Peter Mortensen

I have solved my first question: Open Eclipse, open the SDK Manager, and choose the device to open.

Or you can open the SDK directory. Open the SDK Manager, and then choose the device to open

2: Close Eclipse, and then open it.


P
Peter Mortensen

Make sure USB debugging on your phone is turned on. ADB kill-server and ADB start-server is not the problem.

C:\Documents and Settings\Administrator> adb nodaemon server

 - cannot bind 'tcp:5037'

C:\Documents and Settings\Administrator> netstat -aon | findstr "5037"

 - TCP 127.0.0.1:1130 127.0.0.1:5037 TIME_WAIT 0
 - TCP 127.0.0.1:1269 127.0.0.1:5037 TIME_WAIT 0
 - TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3088
 - TCP 127.0.0.1:5037 127.0.0.1:1128 TIME_WAIT 0
 - TCP 127.0.0.1:5037 127.0.0.1:1129 TIME_WAIT 0
 - TCP 127.0.0.1:5037 127.0.0.1:1270 TIME_WAIT 0

C:\Documents and Settings\Administrator>tasklist -fi "pid eq 3088"

 - Image name PID session name session # memory usage

========================= ====== ================ ======== ============

 - adb.exe 3088 Console 0 3,816 K

C:\Documents and Settings\Administrator>taskkill /f /pid 3088

 - Success: terminate the PID for the process of 3,088.

C:\Documents and Settings\Administrator>adb start-server

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

d
dell116

I've already up-voted another answer here to this question, but just in case anyone was wondering, you don't need to restart Eclipse to get ADB running again. Just open a shell and run the command:

adb start-server

If you haven't set the path to ADB in your system properties then you must first go to the directory in which ADB exists(in Android\android-sdk\platform-tools....I'm running Windows, I don't know how the mac people do things).


That doesn't matter. I get the error from command line as well.
I didn't find a way how to do it on Mac. Force quitting ADB didn't help so I had to restart whole computer. Then it worked again.
H
HiTechHiTouch

Run over to sysinternals.com and pick up TCPVIEW and PROCESS EXPLORER, if you don't have them installed already.

For some reason, the ADB daemon is terminating before the close socket exchange is complete. If you run (from the command prompt) "NETSTAT -o", you will see the socket (generally 5037) in CLOSE_WAIT state and the owning process number. Process Explorer won't show that process ID (the daemon terminated), and the process called adb.exe (which opened the socket) will be gone. (If adb.exe if found, try killing the task and see if things get cleaned up.)

Using TCPVIEW, locate the hung socket. The process name column will show the associated process can not be found. Right click, and select "Close Connection". The socket is now closed, and the adb daemon should be able to start.


Helpful. Also, in the Process Explorer, if you see an adb.exe running with the Path column showing [Error opening process], that can be the likely culprit.
P
Peter Mortensen

I had a similar issue. Killing an existing instance of the ADB process from Task Manager did not work for me.

Just few days back, I had tried to install MIPS SDK and ADT-17 earlier and Eclipse gave me the error, and I did not fix that issue.

So, now, when I got this ADB server didn't ACK, failed to start daemon... issue, I executed 'Check for Updates' in the Eclipse Help menu item. There were no updates available, but at least 'ADB server did not ACK' error disappeared.

I hope this might help in a few cases.


P
Peter Mortensen

Type ./adb nodaemon server in a terminal.

If it returns Invalid content in adb_usb.ini, then there is a problem with your adb_usb.ini file in the .android folder.

Open adb_usb.ini and erase its contents. Then restart the server...it worked for me.


P
Peter Mortensen

Check for the path of the Android directory. It should not contain spaces, etc.

Also check if the plugin has been properly configured in Eclipse → Preferences.

In my case I had everything checked multiple times, but it was still not working. I was about to reinstall everything, but I came upon an answer on this site (some other post).

Do check your antivirus. It may be blocking the ports of adb.exe or emulator programs, etc. That solved the problem in my case.


P
Peter Mortensen

In addition to @Bastet's solution:

Actually we have to kill the process using the address 0.0.0.0:0. That's why for most of the people killing adb.exe from Task Manager was working (in my case I was not able to see it even in Task Manager).

Following the @Bastet steps, I found out that some other process was using this address. I went ahead to kill it, and it gave me ACCESS DENIED as Error.

So using the tasklist | findstr **** I found out the name of the process and killed it from Task Manager.

Thereafter it started working.

In my case bas_daemon and bas_helper were using this address both of which corresponds to MOBOROBO.


P
Peter Mortensen

I had the same problem. But there was no process of adb on my laptop. I just log out and log in to my account, and it's resolved...

ADB could start from CMD windows after that.


P
Peter Mortensen

The best and the most efficient way without restarting any device or software is:

Run the following:

adt-bundle-windows-x86_64\sdk\platform-tools\adb.exe

And one more thing.. ADB is a self-dependent thing. You cannot do anything until unless it wants itself to work. There is one more way which I found out: Leave the device connected for 5-6 minutes and wait. Soon the device gets connected and tries to launch.


P
Peter Mortensen

This didn't start happening for me until I rooted my Samsung Galaxy S III phone (following the xda-developer forum guide).

It happens pretty randomly, but it's definitely occurring while running Eclipse.

Killing the adb.exe process and restarting it solves the problem.


P
Peter Mortensen

Look at the antivirus or firewall... Does any of that block you from access... In k7 antivirus I turned off system monitor, and it does works for me...


V
Venkatesh A

Linux/Ubuntu users this might also be the case.... i had an android emulator running and I had to kill that. To do that do the following

lsof -i :5307

(use sudo if needed) Note the pid in the result of above command. Then

kill -9 <pid_from_above>

then go ahead with

adb shell

T
Terel

I had to allow adb.exe to access my network in my firewall.


I am using this firewall: sphinx-soft.com/de/Vista/order.html All I have done was changing the rule of adb.exe to allow all
P
Peter Mortensen

Killing Eclipse and then rebooting did not help me. I added the Android tool to the PATH variables, started Task Manager and killed adb.exe.

I restarted Eclipse, and then it worked.