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.
Try opening a command prompt and enter "netstat -a" to see a list of ports that are currently in use on your machine. Then pick a port that's not in use.
Right-click the integration server, and click Flow Debug Port > Enable to enable debugging on the selected integration server.
To solve this, simply remove the jar of the debugged module from all modules' dependencies in the Project Structure. If you do not know which modules have the debugged module jar as dependencies, you can use some tools (Eg. Sublime Text, bash, ...) to search for the module name which is stored in Intellij *.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With