Leem.fin
Leem.fin

Reputation: 42622

adb cannot bind 'tcp:5037'

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)

Upvotes: 17

Views: 31201

Answers (9)

Taiyr Begeyev
Taiyr Begeyev

Reputation: 627

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

sudo adb start-server

Upvotes: 0

Braian Coronel
Braian Coronel

Reputation: 22877

  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

Upvotes: 3

Soner PALANCI
Soner PALANCI

Reputation: 114

I tried it at the OS Terminal, worked.

Try on the OS terminal first

Upvotes: 0

Tushar Saha
Tushar Saha

Reputation: 2106

I ran adb kill command and then it started working fine

adb kill-server
adb start-server

Upvotes: -1

Arshid KV
Arshid KV

Reputation: 10037

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.

Upvotes: 19

Parinda Rajapaksha
Parinda Rajapaksha

Reputation: 3109

Kill the Adb server and restart.

adb kill-server
adb start-server

enter image description here

Upvotes: 8

Manuel Schmitzberger
Manuel Schmitzberger

Reputation: 5468

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

Upvotes: 1

Leem.fin
Leem.fin

Reputation: 42622

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!

Upvotes: 5

Jiang YD
Jiang YD

Reputation: 3311

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

Upvotes: 1

Related Questions