3

===============================

*SOLVED * : see answer below

I dont want to use Eclipse.

From the command line:

An emulator is running. adb server is running. "adb devices" lists correctly and I can see my instance on an avd in the output.

However when I manually start DDMS from the command line it just keeps trying to connect. I can find no connection config issues.

Any suggestions (other than "use Eclipse") most welcome!

(yes, it works from within eclipse and ddms shows threads etc)

System : Debian Squeeze

Update : I ran update-java-alternatives to be sure java was set up properly for "Java(TM) SE Runtime Environment (build 1.6.0_20-b02)" . Not too much of a surprise to seasoned Debian users my Java is now worse ... When I run ddms from the command line I get :--

(ddms:9326): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:29 E/ddms: Failed to reopen debug port for Selected Client to: 8700
04:29 E/ddms: Invalid argument
java.net.SocketException: Invalid argument
    at sun.nio.ch.Net.bind(Native Method)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
    at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(MonitorThread.java:716)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:226)

04:29 E/DeviceMonitor: Connection attempts: 1
04:30 E/DeviceMonitor: Connection attempts: 2
04:31 E/DeviceMonitor: Connection attempts: 3
04:32 E/DeviceMonitor: Connection attempts: 4
04:33 E/DeviceMonitor: Connection attempts: 5
04:34 E/DeviceMonitor: Connection attempts: 6
6
  • when you try ddms standalone, do you have eclipse ddms running as well? (if so, shutdown eclipse first). ddms is not connecting to your device at all or not attaching to the process of your app? do you see the device in the device list? (or from where do you see that it's trying to connect?) Commented Aug 11, 2010 at 17:27
  • which system I you running on? windows? linux?...
    – Sephy
    Commented Aug 11, 2010 at 17:28
  • ddms from the command line sees no devices. Elcipse is not running. I also restarted the adb server.
    – RichieHH
    Commented Aug 12, 2010 at 15:39
  • Instead of updating your question, you should submit an answer to it. Better follows SO paradigm Commented Aug 12, 2010 at 18:08
  • 1
    Please tick "the answser" rather than changing the title with "solved". We are not in forums from the 80's any more.
    – rds
    Commented Aug 13, 2011 at 20:38

4 Answers 4

7

The solution is, in Debian, to force java to use IPv4.

/etc/sysctl.d/bindv6only.conf

net.ipv6.bindv6only = 0

And then from bash

sudo invoke-rc.d procps restart

Also see the Debian bug report for more details.

1
  • That's great - I had same problem with amd64 squeeze + IcedTea java, ddms failing to connect both launched manually and in eclipse (indigo 3.7). Now, it's working correctly. By the way, I had to use IcedTea or else the android sdk fails http requests ("network not found").. but maybe I should retry that too, with new configuration..
    – redShadow
    Commented Dec 1, 2011 at 9:33
6

Adding this line somewhere in eclipse.ini helped me:

 -Djava.net.preferIPv4Stack=true

The directive name speaks for itself.

0

I've had this problem too. I've always found that if you close eclipse first before connecting the device, running an emulator, or starting ddms, everything works just fine.

I think the Eclipse SDK hogs the connection and prevents ddms from accessing the device or emulator.

0
0

The IPv4 did not work for me, but plugging the device on a different USB port solved this issue (via Android device not showing up in DDMS)

Not the answer you're looking for? Browse other questions tagged or ask your own question.