79

I get the following error in Eclipse:

[timestamp - ddms] Can't bind to local 8600 for debugger

Why?

John Dvorak
  • 26,799
  • 13
  • 69
  • 83
Rads
  • 913
  • 1
  • 6
  • 6
  • 4
    Port might be jammed. Try restarting `Eclipse` and if that doesn't fix restart `adb` – Pentium10 Jul 23 '10 at 13:54
  • 2
    I've had this issue before when I had the Aptana toolkit installed to Eclipse. If you have that, then I can't help you; the only solution for me was to uninstall it. – Dan Lew Jul 23 '10 at 14:02
  • It means something else is already bound to port 8600. Figuring out what this is will be easy or hard depending on what OS you're running. – fadden Jul 23 '10 at 19:24
  • would you mind fixing the title for better Googlability. I think "ddms]Can't" is confusing Google. "ddms Can't" would be much better. – Doguhan Uluca May 08 '11 at 23:25
  • 1
    Simple eclipse restart worked for me :) – Kishore Aug 27 '13 at 11:59
  • blganesh 's answer below works for me, duplicate ip for localhost, maybe? – Ferry Tan Jun 06 '14 at 03:07
  • was running same project in Eclipse and Android Studio side by side. Closing one of them helped! – Skynet Feb 04 '15 at 07:36

20 Answers20

83

In addition to adding "127.0.0.1 localhost" to your hosts file, make the following changes in Eclipse.

Under Window -> Preferences -> Android -> DDMS:

  • Set Base local debugger port to "8601"
  • Check the box that says "Use ADBHOST" and the value should be "127.0.0.1"

Thanks to Ben Clayton in the comments for leading me to a solution.

Some Google keywords: Ailment or solution for Nexus S Android debugging with the error message: Can't bind to local 8600 for debugger.

Doguhan Uluca
  • 6,933
  • 4
  • 38
  • 51
  • 11
    Just ran into this issue. This solved it for me, but i had to restart adb after making the changes. Simply call `adb kill-server` followed by `adb start-server` on the command line. –  Oct 13 '11 at 13:25
  • Duluca's suggestion worked for me. One addition - on the Mac, Eclipse preferences show up under Eclipse -> Preferences -> Android -> DDMS –  Oct 26 '11 at 14:48
  • doesn't work :(, I use windows 8, avg antivirus and eclipse ADT version 22.3.0, any suggestions ?, thanks !. – Bhimbim May 14 '14 at 06:28
  • 1
    Make sure that the *last* localhost entry in your hosts file is 127.0.0.1. You can even duplicate the line at the top and bottom of the file. It seems that the DDMS lib uses the last localhost entry that it finds. – Harvey May 04 '16 at 13:32
  • 1
    What about for Android Studio – Bugs Happen Aug 24 '16 at 07:10
23

Try killing port 8600 with this command:

fuser -k 8600/tcp

That fixed it for me.

IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147
15

Don't uninstall, this is just a dumb thing done by the system which as trouble finding localhost it seems. Take a look in here, it's quite easy to fix. I had the same issue a few weeks ago and solved it this way.

the window Host file that is messed up:
the file is at this place :
C:\WINDOWS\system32\drivers\etc

And should contain this line : 127.0.0.1 localhost

Sephy
  • 50,022
  • 30
  • 123
  • 131
  • 3
    ok, have you tried checking that the preferences in Eclipse are properly configured? preferences>Android>DDMS>Base local debugger port see the number in this field. – Sephy Jul 24 '10 at 16:53
  • 3
    I had this same problem with the Nexus One - the debugger would never attach even though other devices worked fine (e.g. HTC Wildfire, HTC Legend). I have eclipse with Aptana installed which may have been an issue(as @daniel mentioned in another answer). Changing the 'base debug port' to 8601 solved it for me. – Ben Clayton Mar 08 '11 at 15:58
  • It should not be necessary for the line 127.0.0.1 localhost to be present in the hosts file... isn't this taken care of by default in DNS? – Eric Jun 26 '11 at 04:16
  • I have the same issue, but changing the base debug port to 8601 is not working for me. And I did have aptana installed. – Tom Jan 10 '12 at 02:53
  • My GNU/Linux system was missing "localhost" in the `/etc/hosts` entry for 127.0.0.1. After adding adding it, debugging works again. Thank you! – joelpet Feb 20 '14 at 15:29
11

I had the following hosts file

127.0.0.1 localhost
192.168.1.2 localhost

and i started getting the error continously and it was very annoying

“Can't bind to local 8600 for debugger”
“Can't bind to local 8601 for debugger”
“Can't bind to local 8602 for debugger” and so on

I deleted the second line from the hosts file 192.168.1.2 localhost and everything is back to normal.

Hope this helps.

blganesh101
  • 3,647
  • 1
  • 24
  • 44
  • Ow man!!! I've been searching so long why I couldn't attach debugger and this finally send me in the right direction! Thank you! – Sander Versluys Apr 01 '15 at 15:06
  • 1
    Thank you! This was the problem for me, too. On OSX, after playing around, I discovered that if you put another `127.0.0.1 localhost` entry at the end of the file, it'll work. It seems DDMS uses the last localhost entry it finds in the file. – Harvey May 04 '16 at 13:28
  • 1
    I also had to remove other IP which map to localhost in this file for the device to connect to the debugger. – Alocus Nov 02 '16 at 06:18
  • Damn, it was under my nose all this time. I always looked for the 127.0.0.1 but never if there was another entry for localhost. – João Daniel Dec 13 '16 at 17:16
  • Same issue here... but it also means you have to choose between setting IPs to localhost in /etc/hosts whenever the need arises, or running Android Studio in debug mode :/ – Kheldar Feb 08 '18 at 14:13
8

In addition to adding 127.0.0.1 localhost to your hosts file, make the following changes in Eclipse.

Under

Window -> Preferences -> Android -> DDMS

Set Base local debugger port to 8601

Check the box that says Use ADBHOST and the value should be 127.0.0.1 Thanks to Ben Clayton & Doguhan Uluca in the comments for leading me to a solution.

Some Google keywords:

Ailment or solution for Nexus S Android debugging with the error message: Can't bind to local 8600 for debugger.

Vivo
  • 768
  • 1
  • 8
  • 20
Anil Chahal
  • 2,544
  • 2
  • 22
  • 19
7

For people running Android Studio and Eclipse:

I know that answers are already saturated, but I'll just add that it appears that this error surfaces after installing Android Studio and returning to Eclipse to build and run your project.

Make sure you close all other instances of ADB that may be running (including Android Studio). Once you've done this if you are still having troubles try killing all ADB server processes and restarting. If you haven't setup a global variable, open terminal and navigate to the platform-tools folder of the Android SDK Eclipse is referencing, then run:

./adb kill-server
./adb start-server
Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
  • thanks. restarting adb has been useful for me even though i run *only* Android Studio. it seems that sometimes when i shutdown an emulator by clicking its "x" on the attached toolbar (in the upper right), the port is not freed up. subsequent attempts to run my app in a new emulator instance sometimes have the "can't bind" problem. so i have to restart adb from a command line, as you suggest. – albert c braun Mar 24 '17 at 19:34
7

I had a similar problem on OSX. It just so happens I had opened two instances of Eclipse so I could refer to some code in another workspace. Eventually I realized the two instances might be interfering with each other so I closed one. After that, I'm no longer seeing the "Can't bind..." error.

Cruinh
  • 3,611
  • 4
  • 38
  • 45
4

I'm running the Android ADT bundle on Windows 8. Both solutions described in this topic (editing the host file and changing the eclipse preferences) did not solve the problem.

In my situation the problem has been solved by a de-installation of Java 7 (now using Java 6). The debugger is now working again!

Peter
  • 10,910
  • 3
  • 35
  • 68
4

Running two instances of adb (eg eclipse debugger and android studio) at same time causes conflicts as this too

Joshua. O
  • 71
  • 1
  • 9
3

On Windows 8 I was batteling with this for some time:
do you have AVG installed? uninstalling AVG did the trick for me

Elad Gelman
  • 1,182
  • 1
  • 13
  • 27
3

For me, this was due to the fact that I was trying to debug using eclipse yet also running Android Studio. Both programs were trying to monitor android devices on the similar ports. Either quit all IDEs other than one, or modify the port number used for debugging in the IDE preferences so they are not similar.

Brian
  • 31
  • 2
3

In my case the problem was that there was a ghost eclipse hanging on background; it was not using any workspace and had no windows, so it was only on process list that I found it. Killing it resolved the issue.

Zds
  • 4,311
  • 2
  • 24
  • 28
2

In my case, it just worked when I killed the Eclipse process, and restart the software.

androidevil
  • 9,011
  • 14
  • 41
  • 79
2

On my mac from a terminal:

$ ./adb kill-server
$ ./adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

I opened the eclipse and set the ddms port to 5037. it works fine.

enter image description here

Alp Altunel
  • 3,324
  • 1
  • 26
  • 27
1

The only fix that really worked for me was uninstalling Java 7 and installing Java 6 on my Windows 8 x64 based machine.

You can download Java 6 from here.

EvZ
  • 11,889
  • 4
  • 38
  • 76
1

Try another cable and if that doesn't work try another phone.

I wrestled with this and all the tips above for several days. But the connector on my devices was flakey. As a test move the phone and see if you get connections dropping.

Some of the tips such a ADB USB will fix it temporarily and explicitly (re) selecting the device process to debug. But for me the root cause was that the physical connection.

So now with the new device I have no problem ever! A flakey cable would cause the same issue. Good luck! I feel your pain.

0

Based on an Aptana Studio support response, it was confirmed that the Aptana plugin and Android Development Tools collide on this port (i.e. Aptana's Comet server overlapped on this port). Aptana opened a ticket back in 2010.

Unfortunately, it does not appear that Aptana has fixed it yet or made their Comet server port configurable. Changing the port number in eclipse and restarting adb did NOT fix it for me. I finally was forced to uninstall the Aptana plugin.

kenj
  • 130
  • 4
0

Worked for me, based on this answer

In Eclipse go to

Window->Preference->Android->DDMS

Then tick "Use ADBHOST" as "127.0.0.1".

Then just restart eclipse

Community
  • 1
  • 1
Matteo A
  • 358
  • 5
  • 15
0

After hours trying to fix it with java sdks, eclipse.ini file, and all material found on the question, what definetely worked for me :

UINSTALLED AVG ANTI-VIRUS

then all ports on DDMS get green, no matter java or Genymotion settings or what the...

0

Maybe it's too late for an answer to this question but i think i have found a fix for it, what i noticed is within the info.plist file > JVMoption (Mac) with in the application package there is two version of java i.e it was showing "1.6*,1.7+" so i just changed it to "1.8*" which is my current java version and now its working for me

Hey
  • 1
  • 1