mac:macOS Sierra 10.12.2
eclipse:Version: Neon.1a Release (4.6.1)
debug時進度一直停在93%,然后超時報錯:
![](https://dn-binger.qbox.me/20170110/17011001.png)
ERROR: transport error 202: gethostbyname: unknown host
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
分析錯誤提示,是找不到主機host,google一下暇唾,在stackoverflow找到了解決方案,在hosts中加入
127.0.0.1 localhost
-hosts修改方法:
hosts不能直接在/etc中修改;
在Finder中坡锡,點擊shift+command+G,輸入/etc窒所,將hosts文件拷貝到桌面鹉勒,修改后再拷貝回去(需要輸入密碼)。
再次debug吵取,正常禽额!
![](https://dn-binger.qbox.me/20170110/17011002.png)
- 參考: