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?

Ender Look
  • 2,303
  • 2
  • 17
  • 41
teacher-too
  • 221
  • 1
  • 2
  • 4

9 Answers9

26
adb kill-server

if happens an error with port:

adb reconnect solve it for me

Acauã Pitta
  • 654
  • 1
  • 9
  • 16
  • 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. – loved.by.Jesus Sep 13 '22 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
vbevans94
  • 1,500
  • 1
  • 16
  • 15
  • 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. – Rafi Ali Khan Apr 18 '17 at 20:22
  • [what my sdk manager looks like](https://ibb.co/mGrOFk) 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). – Rafi Ali Khan Apr 18 '17 at 20:49
  • Thanks, After digging couple of weeks, this solved my problem. – Ajit Apr 20 '17 at 08:15
  • Just, killing the other process worked for me. Thanks a lot ! – Tom Taylor Mar 19 '20 at 07:28
  • After days of searching and trying so many solutions online, this solved my issue. Thanks so much. – ali sampson Apr 05 '23 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!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • I am run " lsof -n -i4TCP:5037 | grep LISTEN" – teacher-too Apr 01 '17 at 02: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 – teacher-too Apr 01 '17 at 03: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.

1mike12
  • 2,946
  • 3
  • 27
  • 36
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

Nils Fett
  • 385
  • 4
  • 13
  • 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。 – teacher-too Apr 06 '17 at 01: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.

Sinapse
  • 143
  • 1
  • 11
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.

pvalle
  • 1,335
  • 1
  • 13
  • 20
0

Restart your PC

This is the only way worked for me.

MJ Studio
  • 3,947
  • 1
  • 26
  • 37
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.

ali sampson
  • 321
  • 4
  • 7