17

It used to work fine, but today after I connected my Android phone to my machine, and run adb devices, I got the following error:

* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon: Operation timed out

How to solve this problem? (I am using a MacBook)

Leem.fin
  • 40,781
  • 83
  • 202
  • 354
  • http://superuser.com/questions/814386/adb-fails-with-cannot-bind-local5037 – Tim Jan 18 '16 at 09:03
  • @TimCastelijns, my problem is different than the linked one you provided. Read carefully. The linked problem has error `cannot bind 'local:5037'` but my problem has error `cannot bind 'TCP:5037'` – Leem.fin Jan 18 '16 at 09:07
  • I don't claim it's a dupe. Just providing some information in case it may be useful – Tim Jan 18 '16 at 09:11

9 Answers9

19

Try with following commands

Find port details by List Open Files lsof command.

sudo lsof -i :5037 and find PID and kill it.

kill -9 <pid here>

Example: kill -9 4363

Then start adb server. adb devices command.

Arshid KV
  • 9,631
  • 3
  • 35
  • 36
8

Kill the Adb server and restart.

adb kill-server
adb start-server

enter image description here

Parinda Rajapaksha
  • 2,963
  • 1
  • 36
  • 40
5

I managed to 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!

Gerard
  • 2,832
  • 3
  • 27
  • 39
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
3
  1. Android Studio Terminal

$ adb devices

List of devices attached
adb server is out of date.  killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error: 
error: 
  1. OS Terminal

$ adb devices

List of devices attached
adb server is out of date.  killing...
* daemon started successfully *
  1. Finally test again at the IDE terminal

$ adb devices

List of devices attached

GL

Braian Coronel
  • 22,105
  • 4
  • 57
  • 62
1

it is clear that Address already in use. busybox netstat -antp to check who is using the port.

Jiang YD
  • 3,205
  • 1
  • 14
  • 20
  • Yes , error message is clear that `address is in use`, but I am not sure how to list all the processes using that port & kill them – Leem.fin Jan 18 '16 at 09:10
  • and what is `busybox`? I don't want to install extra tool to solve this problem. – Leem.fin Jan 18 '16 at 09:23
  • Check this answer which helped me. The issue might be with the latest unstable version of platform-tools. http://stackoverflow.com/questions/43131020/adb-cannot-connect-to-daemon-at-tcp5037 – Ajit Apr 20 '17 at 08:19
1

I've fixed the problem by updating the Android SDK.

android update sdk --no-ui  

Additionally, I've updated the Platform Tools to the newest version.


If this doesn't work, redownload 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

Manuel Schmitzberger
  • 5,162
  • 3
  • 36
  • 45
0

I tried it at the OS Terminal, worked.

Try on the OS terminal first

0

Running the following command at the OS bash helped solve the issue:

sudo adb start-server
Taiyr Begeyev
  • 547
  • 1
  • 9
  • 12
-1

I ran adb kill command and then it started working fine

adb kill-server
adb start-server
Tushar Saha
  • 1,978
  • 24
  • 29