SamuraiSong SamuraiSong - 1 year ago 315
Android Question

android studio can't connect to debug devices

Android Studio can't connect to debug devices.

When I click the debug button, the debug tab shows me

Connecting to the target VM, address: 'localhost:8600', transport: 'socket'

in variables

When I tried again it told me

12:14:44 Error running Android Debugger (8600): Unable to open debugger port : "handshake failed - connection prematurely closed"

and then debug tab show me this

Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

in variables

My Android Studio version is
0.4.4 #AI133-1005886

This problem has been haunting me for a long time.

i use OS X

Answer Source

This is how I solved same issue:

1) I don't think that it is important but I: updated all pending for update ADT stuff. And restarted OS. But I still was unable to debug

2) Next: I launched AS. Opened terminal and ran this:

./adb get-state
  • daemon not running. starting it now on port 5037 *
  • daemon started successfully *

As you can see daemon started automatically after I asked for its state. So I did not do nothing more. Just tried to debug and this time debugging worked.

P.S. After I restarted AS debugging continued working. So there was no need in terminal manipulations anymore

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download