Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the error "Unable to open debugger port " in Android Studio?

Error running Android Debugger (8600):
    Unable to open debugger port (localhost:8600):
    java.net.SocketException "Connection reset"
like image 638
arun8 Avatar asked Sep 03 '15 16:09

arun8


People also ask

How do I open an Android debugger?

You can access the developer menu by shaking your device or by selecting "Shake Gesture" inside the Hardware menu in the iOS Simulator. You can also use the ⌘D keyboard shortcut when your app is running in the iOS Simulator, or ⌘M when running in an Android emulator on Mac OS and Ctrl+M on Windows and Linux.

How do I change the debugging port in IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Debugger. In the Built-in server area, specify the port where the built-in web server runs. By default this port is set to the default IntelliJ IDEA port 63342 through which IntelliJ IDEA accepts connections from services.

What debugging tools are available for Android?

Logcat and Debug are two tools that come built-in to Android Studio, which you can use to identify and fix bugs in your Android code.


7 Answers

I was able to fix this with these commands:

  • adb kill-server
  • adb start-server
like image 57
natishka Avatar answered Oct 05 '22 12:10

natishka


Try Restarting ANDROID STUDIO (Worked for me)

like image 43
Ismail Iqbal Avatar answered Oct 05 '22 10:10

Ismail Iqbal


In my case, there was another service running on my laptop(Windows) that was using the port 8600. I opened Task Manager and stopped the service. Now, I could debug my application normally without the above error.

like image 44
arun8 Avatar answered Oct 05 '22 10:10

arun8


I solve the problem by checking my localhost.

Making sure 127.0.0.1 localhost.

like image 37
lirui Avatar answered Oct 05 '22 12:10

lirui


For me this problem started when i upgraded my Android Studio to new version.

Please go to options menu Build and choose Clean Project.

enter image description here

That is it project started to run again and error was gone.

like image 31
MindRoasterMir Avatar answered Oct 05 '22 12:10

MindRoasterMir


I tried other answers (e.g. restarting Android Studio) but they didn't solve this for me.

I had accidentally selected MTP (Media Transfer Protocol) in my Developer Options/USB Configuration. It started working once I set it to PTP (Picture Transfer Protocol).

EDIT: On reflection it's probably just that I changed the protocol because I've had the same issue since while on PTP. Hence I'm suggesting that the real answer is to change the protocol on the phone and, if you might need it, don't forget to change it back.

like image 38
RowanPD Avatar answered Oct 05 '22 10:10

RowanPD


It could be that you need to wait for your code to stop compiling before you attached the debugger. I had a similar error and all I needed was patience.

like image 44
biqi Avatar answered Oct 05 '22 11:10

biqi