I downloaded the latest Android SDK and connected my Nexus One. Once starting DDMS, it throws up this
[codesyntax lang=”xml” title=”DDMS error”]
user@wanaka-ubuntu:~/android-sdk-linux_x86/tools$ ./ddms
(ddms:10868): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:37:36 E/ddms: shutting down due to uncaught exception
04:37:36 E/ddms: java.lang.UnsatisfiedLinkError: Can’t load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)
…
[/codesyntax]
If you read the log, you realize it tries to use the openjdk version, but we want to use the SUN (ahem Oracle) JRE.
Open the ddms script file and change the line (around line no.65)
javaCmd=”java”
to
javaCmd=”/usr/lib/jvm/java-6-sun-1.6.0.22/bin/java” (adapt it to your proper path to the java binary!)
There we go ! Lets snoop inside the phone
and we can even create screenshots !
Or, if you’ve installed JDK in order to develop Andoid applications, you must tell DDMS to EXPLICITLY use your JDK installation. In my case ‘~/java’:
javaCmd=’~/java/bin/java’
because libmawt.so is found under ‘~/java/jre/lib/amd64/xawt’