DDMS - Can't bind to local 8600 for debugger on Android Studio

62,510

Solution 1

Try killing the adb server and restarting the adb server from terminal.

adb kill-server
adb start-server

Also on your mobile device, toggle the usb debugging. Both of these combine worked for me when I had this issue.

Also you may want to consider using Stetho by Facebook, you can view your database as well as run queries with Stetho. Stetho also lets you watch network calls, view your view hierarchy and more.

Solution 2

On Mac, Open terminal and type:

    sudo nano /etc/hosts

Add following line to your hosts file

127.0.0.1        localhost

Save and exit.

In Android Studio, you can start debugging again. I got stuck with the same problem and I ended up doing above, problem solved.

Hope this helps :) .

Solution 3

For osx users

Yes you need to restart adb. Simply restart android studio should do the trick. If it's still not working, force killing the thread on port 8600 by this

[sudo] lsof -i :8600

Then for the PID

kill -9 <PID>

Solution 4

A similar question helped me solve this issue here:

Android Studio and android device monitor

By opening DDMS from within Android Studio, I am able to bind and monitor my android devices with no more broken pipes or port conflicts.

Simply follow these steps to open DDMS from within android studio: Select Tools > Android > Android Device Monitor

I can only assume AS runs a DDMS instance silently, since when AS is closed, manually opening DDMS has no issues. Only when AS is running do I get this when running DDMS from the CLI

Share:
62,510

Related videos on Youtube

Tosin Onikute
Author by

Tosin Onikute

Updated on July 09, 2022

Comments

  • Tosin Onikute
    Tosin Onikute almost 2 years

    Am trying to view my database tables using Android Device Monitor and It showing me Errors for reasons which i am not really sure of. And i don't have another instance of DDMS running.

    Instead of showing my DDMS, Its showing me this errors

    [2015-09-10 17:39:53 - ddms] Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.
    [2015-09-10 17:39:53 - ddms] Can't bind to local 8600 for debugger
    [2015-09-10 17:39:53 - ddmlib] Broken pipe
    java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
        at sun.nio.ch.IOUtil.write(IOUtil.java:65)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
        at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
        at com.android.ddmlib.Client.sendAndConsume(Client.java:677)
        at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
        at com.android.ddmlib.Client.requestAllocationStatus(Client.java:523)
        at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:847)
        at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
        at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:775)
        at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:664)
        at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
        at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
    

    Please, any one knows a solution to this ???

  • Tosin Onikute
    Tosin Onikute over 8 years
    Thanks, Stetho also led me in finding another tool SQLite Browser sqlitebrowser.org which i also got by reading this answer now, stackoverflow.com/questions/17529766/… . cheers
  • Kamran Bigdely
    Kamran Bigdely over 7 years
    "toggle the usb debugging" solved my issue. So go to developer options on your android device and off, then on usb debugging.
  • beyondtheteal
    beyondtheteal about 6 years
    I don't know why this worked, but it did work for me. I tried the accepted answer a few times before I tried this one.
  • SAIR
    SAIR almost 6 years
    Man you just answered my days of struggle
  • Udit Kapahi
    Udit Kapahi almost 6 years
    @SAIR glad to know it helped :D.
  • Neph
    Neph almost 6 years
    Thanks, killing adb fixed it. For me it was caused by having Android Studio and Eclipse open at the same time, so I could debug two different apps. I also closed AS and restarted Eclipse just to be on the safe side.
  • Dan
    Dan over 5 years
    This has been bugging me for ages and this solution was the only thing that worked. Thanks a lot.
  • Udit Kapahi
    Udit Kapahi over 5 years
    @Dan feels good to knw that soln helped someone in same situation.. Cheers
  • Vignesh
    Vignesh about 5 years
    i tried the above step it's not working for me.... cd /Users/varunagiri/Library/Android/sdk/platform-tools adb kill-server -bash: adb: command not found
  • earthdan
    earthdan about 5 years
    No one is listening, can run a python3 -m http.server 8600 as well. But Android studio will give this error! Any idea?
  • tcobbs
    tcobbs almost 3 years
    Years later, this solution helped me too. Before making the suggested edit to /etc/hosts, I checked what localhost was doing, and it was resolving to an internal IP for my company. (localhost.<company>.com was set up to point somewhere for some reason.)