Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB server didn't ACK on macOS

I am getting this error since two days ago when I updated my Android Studio to the latest stable version 2.3; the full error message I am getting from Gradle Console is:

07:59:59 E/adb: error: could not install *smartsocket* listener: Address already in use
07:59:59 E/adb: ADB server didn't ACK
07:59:59 E/adb: * failed to start daemon *
07:59:59 E/adb: error: cannot connect to daemon
07:59:59 E/ddms: '/Users/USER_NAME/Library/Android/sdk/platform-tools/adb start
server' failed -- run manually if necessary

My attempts to solve the issue:

  • kill all adb processes and make sure no process is holding port 5037, adb kill-server (says * server not running * even in cases when adb is running), close Android Studio, delete ~/.android directory, run adb start-server (says * daemon not running. starting it now at tcp:5037 *; * daemon started successfully *, start Android Studio and run application, MAC throws error adb quit unexpectedly and gradle console shows same the error I posted above.

  • uninstalled and deleted all Android Studio stuff (except for projects directory), restarted MAC, installed fresh and latest android studio.

  • increased gradle vm ram org.gradle.jvmargs=-Xmx1536M in project gradle.properties

  • uninstalled antivirus and restarted the mac

Environment:

  • OS: MacOS Sierra 10.12.3
  • Android Studio: 2.3
  • buildToolsVersion: '25.0.0'
  • Android Debug Bridge version: 1.0.39
like image 810
PeaceDefener Avatar asked Mar 27 '17 00:03

PeaceDefener


4 Answers

Address already in use means you have another instance of adb running. Check your system variable $PATH and $ANDROID_HOME and local.properties file (of your project) and your .bash_profile . Make sure that all of these has same android sdk path. Then try restarting the adb server. adb kill-server and adb start-server.

like image 175
JIthin Avatar answered Oct 06 '22 16:10

JIthin


I read that you killed the adb, but as this answer says How to resolve the "ADB server didn't ACK" error? did you do that from the platform-tools folder? If your answer is yes, update the Android SDK to the lastest version via the SDK manager and update the $ANDROID_HOME

I hope it helps!

like image 38
Jaco Avatar answered Oct 06 '22 15:10

Jaco


I usually find this issue occurring when I have two instances of ADB working, i.e when I have my Eclipse and Android studio running at the same time AND when they point to different SDK Manager(platform-tools folder) on the system. Try to search for what other IDE is using ADB, kill it in the Activity Monitor and run only one instance. Or my work around was to have only one SDK Manager and point both my IDEs to one platform-tools folder.

Hope that helps.

like image 1
Neha Avatar answered Oct 06 '22 15:10

Neha


In my case, I had an old version of adb installed using brew cask. And while I updated my Android Studio to the latest, the adb was still pointing to the brew installed older version.

So after updating that version, using:

brew cask install android-platform-tools

And making sure that the adb itself was pointing to the new version, the errors went away.

like image 1
Edward Tan Avatar answered Oct 06 '22 14:10

Edward Tan