mac 模拟器debug运行报Can't bind to local XXXX for debugger

问题描述:mac 运行debug一直报错:Can't bind to local XXXX for debugger。
重启Android studio adb kill-server adb start-server,发现没有任何反应。而且每次
adb kill-server 之后,adb会倒计时10秒重启。非常诡异。
最后还是上stackoverflow 寻找到解决方案,原来是我之前在开发h5时,在hosts文件中设置了多个localhost导致的。
解决办法:
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.

windows出现无法debug也是一样的。
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.

原文地址:https://stackoverflow.com/questions/13198646/cant-bind-to-local-xxxx-for-debugger

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容