问题
I keep getting the Can't bind to local XXXX for debugger
message in console, but not for 1 port, for all random ports. I have done what's stated in this question, but with no luck.
I'm running Windows 8. In fact, these problems started after the upgrade to Windows 8.
[2012-11-02 16:40:41 - ddms] Can't bind to local 8627 for debugger
[2012-11-02 16:40:41 - ddms] Can't bind to local 8617 for debugger
[2012-11-02 16:40:42 - ddms] Can't bind to local 8605 for debugger
[2012-11-02 16:40:42 - ddms] Can't bind to local 8610 for debugger
[2012-11-02 16:41:46 - ddms] Can't bind to local 8611 for debugger
[2012-11-02 16:41:46 - ddms] Can't bind to local 8611 for debugger
[2012-11-02 16:41:47 - ddms] Can't bind to local 8611 for debugger
[2012-11-02 16:42:36 - ddms] Can't bind to local 8611 for debugger
[2012-11-02 16:42:38 - ddms] Can't bind to local 8611 for debugger
[2012-11-02 16:42:39 - ddms] Can't bind to local 8622 for debugger
[2012-11-02 16:42:39 - ddms] Can't bind to local 8608 for debugger
[2012-11-02 16:42:39 - ddms] Can't bind to local 8608 for debugger
[2012-11-02 16:42:48 - ddms] Can't bind to local 8609 for debugger
[2012-11-02 16:42:48 - ddms] Can't bind to local 8609 for debugger
[2012-11-02 16:43:32 - ddms] Can't bind to local 8609 for debugger
[2012-11-02 16:43:36 - ddms] Can't bind to local 8625 for debugger
[2012-11-02 16:43:36 - ddms] Can't bind to local 8619 for debugger
What can I do?
Edit
I've tried a new install of the Android SDK, and a new Eclipse install. I've also tried to turn off my firewall.
回答1:
I had same problem and none of given solutions worked. Then I have uninstalled all JRE 7 and installed latest JRE 6 (http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html). It have immediately fixed the problem.
回答2:
Open platform-tools in cmd and run these two commands
C:\Users\SH-PC-W8.1-3\AppData\Local\Android\Sdk\platform-tools
adb kill-server
adb start-server
This works perfectly.
Note: choose your platform-tools location
回答3:
In my case, this problem was caused by AVG antivirus. I tried adding exceptions and shutting it down only for development but that didn't work. I uninstalled it and the problem was solved after a restart.
回答4:
C:\WINDOWS\system32\drivers\etc\host
And should contain this line :
127.0.0.1 localhost
If you have ipv6 ip address ::1 in your host file you need to delete or remark it.
回答5:
For Mac: Check your /etc/hosts file. Ensure that there is no any local ip for localhost. I added and forgot that i added a local ip (ex: 192.168.2.1) for localhost.
回答6:
If you got the error like "Can't bind to local 8700 for debugger" in android studio then just close the emulator and then open the emulator again, this time you mustn't seen the error, this happens to me
回答7:
This might not be so constructive but I would recommend installing Linux. :-)
On the more serious side: Install VMWare or VirtualBox and run it in from a virtual machine with e.g. Ubuntu as OS. You can easily map your USB drive to the virtual machine.
来源:https://stackoverflow.com/questions/13198646/cant-bind-to-local-xxxx-for-debugger