Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
753 views
in Technique[技术] by (71.8m points)

android - Unable to open debugger port : java.net.ConnectException "Connection refused"

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

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 

UPDATE:

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

lsof -i :8601

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...