RichieHH
RichieHH

Reputation: 2123

Android development : ddms from command line not seeing devices

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

*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

Upvotes: 3

Views: 8324

Answers (4)

RichieHH
RichieHH

Reputation: 2123

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.

Upvotes: 7

rds
rds

Reputation: 27004

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)

Upvotes: 0

sanmai
sanmai

Reputation: 30941

Adding this line somewhere in eclipse.ini helped me:

 -Djava.net.preferIPv4Stack=true

The directive name speaks for itself.

Upvotes: 6

CodeFusionMobile
CodeFusionMobile

Reputation: 15130

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.

Upvotes: 0

Related Questions