无法打开调试器端口:java.net.ConnectException“连接被拒绝" [英] Unable to open debugger port : java.net.ConnectException "Connection refused"

查看:158
本文介绍了无法打开调试器端口:java.net.ConnectException“连接被拒绝"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Android Studio v1.0.1 在 macOS Yosemite 10.10 中构建应用程序.当我尝试调试应用程序时,它安装正确但出现错误

I'm using Android Studio v1.0.1 to build an app in macOS Yosemite 10.10. When I try to debug the app, it installs correctly but has the error

运行 [app] 时出错:无法打开调试器端口:java.net.ConnectException连接被拒绝"

Error running [app]: Unable to open debugger port : java.net.ConnectException "Connection refused"

当我运行 DDMS 时,它会显示连接的设备和进程.只是在 Android Studio 中尝试调试时出现问题.

When I run the DDMS, it shows the connected devices and the process. The trouble occurs just when trying to debug in Android Studio.

在其他论坛中,我发现有些东西可能改变了调试器的端口,但这并不能解决我的问题.

In other forums, I've found that something could have changed the port of the debugger, but that doesn't solve my issue.

推荐答案

您的调试端口可能正忙(正在被另一个进程使用).您可以使用以下命令终止与 ADB 调试端口(8601 或更高版本)相关的所有进程:

Your debug port is probably busy (in use by another process). You can kill all the process associated with the ADB debug port (8601 or higher) using this:

fuser -k 8601/tcp 

更新:

OSX 下,lsof 应该代替 fuser 来完成这项工作:

Under OSX, lsof should do the job in substitution of fuser:

lsof -i :8601

这篇关于无法打开调试器端口:java.net.ConnectException“连接被拒绝"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆