22

My adb can't connect devices. I am runing adb start-server

    ulucudeMacBook-Pro:~ ulucu$ adb start-server
    * daemon not running. starting it now at tcp:5037 *
    * daemon started successfully *

Then run "lsof -i tcp:5037"

    ulucudeMacBook-Pro:~ ulucu$ lsof -i tcp:5037
    COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    adb     2308 ulucu    7u  IPv4 0x440443a862048a7b      0t0  TCP localhost:5037 (LISTEN)

But when I run adb kill-server

    ulucudeMacBook-Pro:~ ulucu$ adb kill-server
    * server not running *

or run adb devices or adb shell

    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    adb E 03-31 09:30:26  2350 95705 usb_osx.cpp:333] Could not open interface: e00002c5
    adb E 03-31 09:30:26  2350 95705 usb_osx.cpp:294] Could not find device interface
    error: could not install *smartsocket* listener: Address already in use
    ADB server didn't ACK
    * failed to start daemon *
    error: cannot connect to daemon

The adb has been running.
No other processes using "5037" port.
No other simulator like "genymotion".
My system is Mac 10.12.14.
My adb version is 1.0.39.

What's the problem?

9 Answers 9

27
adb kill-server

if happens an error with port:

adb reconnect solve it for me

1
  • It worked for me. I got the error cannot connect to daemon at tcp:5037: Connection timed out because the daemon was not running. adb-reconnect started the daemon. Sep 13, 2022 at 22:30
25

If you have updated to Platform Tools 25.0.4(you can check running android from command line) and it's not working

Just download previous stable version e.g: https://dl.google.com/android/repository/platform-tools_r25.0.2-macosx.zip

Then go to your Android SDK home directory and replace platform-tools folder with the downloaded one.

Then do:

ps aux | grep 5037
kill -9 <pid of process of your incorrectly running adb>

And go

adb devices
5
  • Thanks. This work for me on MacOS. Would never have figured it out. It happened after updating some of the packages to 25.0.x version. Apr 18, 2017 at 20:22
  • what my sdk manager looks like Clearly the path still points to 24.4.1_1 while the Android SDK Tools show 25.0.x (downloaded 25.0.2 as suggested by vbevans94 replaced the folder). Apr 18, 2017 at 20:49
  • Thanks, After digging couple of weeks, this solved my problem.
    – Ajit
    Apr 20, 2017 at 8:15
  • Just, killing the other process worked for me. Thanks a lot !
    – Tom Taylor
    Mar 19, 2020 at 7:28
  • After days of searching and trying so many solutions online, this solved my issue. Thanks so much. Apr 5 at 17:25
10

Based from this thread, you cannot connect because the address is already in use. You may try busybox netstat -antp to check who is using the port. Here's another workaroung which might help:

Solve this problem on MacBook by first running the following command to list the process which is using port 5037

lsof -n -i4TCP:5037 | grep LISTEN

Then, I kill it:

kill -9 <PID>

Then, adb devices works!

Hope this helps!

2
  • I am run " lsof -n -i4TCP:5037 | grep LISTEN" Apr 1, 2017 at 2:18
  • show --> adb 6796 ulucu 7u IPv4 0x440443a854b64753 0t0 TCP 127.0.0.1:5037 (LISTEN) ------------The adb is using 5037 ------------kill it,then ,"adb devices" ------------The same error Apr 1, 2017 at 3:08
3

I tried every answer here and on a few of the other threads here.

  • deleted ~/.android folder
  • killing the server (which doesn't work because it still says can't ACK)
  • greping the process

My adb was through brew, so I just ran brew cask reinstall android-platform-tools and it worked again.

0

Same problem here on Ubuntu.

nils@nils-MS-7597:~$ adb devices List of devices attached * daemon not running. starting it now at tcp:5037 * error: could not install smartsocket listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon

There is only adb listening on port 5037. Killing it does not help.

Did update sdk before. Don't know if that could be the reason.

But redownload android sdk solved it for me:

download android sdk

wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz

tar -xvf android-sdk_r24.2-linux.tgz cd android-sdk-linux/tools

install all sdk packages

./android update sdk --no-ui

1
  • Thank you for your answer。My system is MAC OS。The problem solved。 Reason is the latest system and adb 1.0.39 incompatible。 I use the adb 1.0.36 was no problem。 Apr 6, 2017 at 1:43
0

I cannot believe they totally remove the standalone sdk, they force you to install the latest platform-tools which cause this issue, and you cannot downgrade from the sdkmanager. What a shame. Anyway, just manually downgrade adb to version 1.0.36 and it should work. There is hundreds of issues like these on the internet. Sad.

0

The solution to my problem was to run Android Studio AS ADMINISTRATOR, it seems that when I updated Android Studio to 3.5.2 somehow the status changed, causing me the problem.

0

Restart your PC

This is the only way worked for me.

0

I was able to resolve this issue by following @vbevans94 steps.

Anyone running Android Studio Electric Eel and flutter SDK 3.7.9 will definitely be experiencing this. All I did was to download SDK Platforms tools 33.0.2 from https://androidsdkmanager.azurewebsites.net/Platformtools, anything upwards didn't work for me.

Extract the file and navigate to this path /android-sdk-path/platform-tools and replace it with the new folder platform-tools. Restart Android Studio, Visual Studio Code or any other editor you're using and boom you're good to go.

Not the answer you're looking for? Browse other questions tagged or ask your own question.