Tag Archives: shell

I use nosetests when running my python tests. It is a really neat little tool that will automatically discover and run all tests in the project with one single command line command - nosetests.

But it has more neatness then this. With a simple option it will also print test coverage for the project: --with-coverage, and if coverage should be calculated base on specific packages then use --cover-package which takes a list of packages to calculate coverage on. This is useful when there are library packages for a virtual env or similar within the same directory as you run nose.

I don't like to leave lose ends so to ensure that there are no lingering compiled *.pyc files sitting around I run the following script before commit:

Where <source-dir> should be replaced with directories where source files are. This is a space delimited list. And <package> is replaced with packages which should have coverage statistics calculated.

Please note that this entry has been revisited. The update is available here.

I just had the pleasure to launch the debugging tool for Android called Dalvik Debug Monitor Service. It is a tool that allows you to connect to the different VM's running on an Android emulator or phone. On OS X Snow Leopard this was unfortunately a bit more involved then I would have liked.

Not using the Eclipse IDE I was going to start this from the terminal. The Android SDK 1.5 through back an exception that I could not be bother to decipher so I decided to switch to SDK 1.6 to see how that worked. This time I was first of all requested to export a new shell variable called ANDROID_SWT so that I could create the AVD to use. I pointed this to $ANDROID_HOME/tools/lib where I found a swt.jar file. This worked and my AVD was created and started.

When I then tried to launch the DDMS tool it complained that it could not run a 32 bit SWT implementation on a 64 bit VM. OK, so I search around on the internet to find a 64 bit version of SWT. I found the SWT home page and there I found the download of the latest stable release of SWT for OS X. Great! Downloaded and installed and exported as ANDROID_SWT I got the same error! SWT does not yet support 64 bit OS X platforms as stable!

But I was in luck. I happen to have an install of the latest Eclipse IDE. This happens to be the last of the three OS X options on their download page (as a note of warning Eclipse is quite big). In here you will find the SWT plugin. This is the file you will need to get DDMS to work, I.E where the ANDROID_SWT variable should point. So if you don't want to move files around you can just point the ANDROID_SWT variable to $ECLIPSE_ROOT/plugins. If you want to copy the file to another location I copied the two SWT jar files org.eclipse.swt_3.5.1.v3555a.jar and org.eclipse.swt.cocoa.macosx.x86_64_3.5.1.v3555a.jar.

I would assume that you can download the development source from the SWT teams SVN and build it your self but I found it easier to just link to the Eclipse provided one.