Android: ddms on Snow Leopard
This weekend I got over my fear to update to the latest big cat: Snow Leopard. I have to say that almost everything worked smoothly. It feels like a new clean system, even tough I merely run the upgrade!
Anyway, thanks to the new 64-bit JVM and carbon being 32-bit only, ddms tool from the Android SDK stubbornly refused to start even after half an hour of tweaking the java params.
So I decided to go the hacky way (follow at your own risk):
- download the cocoa 64 bit version of SWT SWT (update: corrected the link)
- download the cocoa 64 bit versions of libswt-cocoa-3610.jnilib (download) and libswt-pi-cocoa-3610.jnilib (download) from the swt 3.6M1 branch
- now go inside the android sdk folder and inside the tools > lib folder substitute swt.jar, libswt-carbon-3236.jnilib and libswt-pi-carbon-3236.jnilib with the corresponding version you just downloaded, having care to rename the new ones to match the old filenames
Et voila, ddms running in 64 bit on Snow Leopard! Enjoy!
dArio

Android ddms cocoa 64 bit, seeing is believing
UPDATE: The new 1.6 r1 SDK is out and is using cocoa swt, but it is still trying to use the 1.5 JVM which is not working for me.
The solution is pretty simple:
Edit the ddms script (in /sdk-path/tools/), find the following lines:
if [ `uname` = "Darwin" ]; then
os_opts="-XstartOnFirstThread"
#because Java 1.6 is 64 bits only and SWT doesn't support this, we force the usage of java 1.5
java_cmd="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java"
else
and substitute with:
if [ `uname` = "Darwin" ]; then
os_opts="-XstartOnFirstThread -d64"
#because Java 1.6 is 64 bits only and SWT doesn't support this, we force the usage of java 1.5
# java_cmd="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java"
java_cmd="java"
else
This way we use the default JVM (specified trough the Java Preferences.app) forcing the use of the 64bit version, with the -d64 (remove it to use the default or use -d32 to force 32bit)
now export a shell variable (I do it in ~/.profile, but you can put anywhere you please) to tell ddms where to find your custom swt.jar lib. Using bash:
export ANDROID_SWT="/path-to-custom-swt.jar/"
Of course the architecture of your swt must match the architecture of the JVM you are using. Currently I’m using the 64 bit 1.6 JVM with the 3.6M1 swt jar (get it here).


