Blackberry development on Mac OS X

25 05 2008

I have recently been dabbling with a bit of Blackberry development. When I started I was using the horrible antiquated, old netbeans based blackberry JDE (the ultimate insult, take a cross-platform java app and turn it into a Windows only app… don’t get me started!) from Parallels. This was painful, so I searched around the web to see if there was something I could do about it.

I happened across this great article on how to use Eclipse for Blackberry development, but the real interesting bit was that the screenshots where on a Mac!! Eureka!

The only bit I want to add to that is the setup of the Blackberry SDK that I did. In my workspace (the place I keep my development stuff, not the Eclipse workspace), I copied the SDK installation except the simulator (C:\Program Files\Research In Motion\BlackBerry JDE 4.3.1) from windows on to my Workspace(~/Desktop/Workspace). Note: I replaced the spaces with -

What I wanted to do now, was to have Eclipse, on the Mac able to publish directly to the simulator living in Parallels. This was painful because Parallels mounts the C drive to a different path on every run.

To solve this, I wrote the following script to find and mount the correct path and put it in ~/bin

#!/bin/bash
c_path=/private`mount | grep fuse.*\/C | sed -e "s/^.*\/private//g" -e "s/C.*\$//g"`C
simulator_path=$c_path/Program\ Files/Research\ In\ Motion/BlackBerry\ JDE\ 4.3.0/simulator
local_jde_path=~/Desktop/Workspace/BlackBerry-JDE-4.3.0

rm -f “$local_jde_path/simulator”
ln -s “$simulator_path” “$local_jde_path/simulator

Now, to get this automatically re-linked every time I start Windows, I wrote this bat file that runs at login. This of course means that if you simply suspend the windows session you will have to manually run either the script above from the Mac or the one below form Windows.

Having downloaded Plink and placed it in C:\Program Files\Putty
@echo off
call "C:\Program Files\Putty\plink.exe" -pw XXXXXXXX you@yourmac ~/bin/link-simulator

Then you put this batch file anywhere on your windows disk and create a shortcut to it in the Start->Programs->Startup (if you really want, you can probably have the batch file live there or create a windows shortcut containing the whole line w/o the call, I haven’t tried it but I imagine it must work)

If you don’t want to keep your password in the batch file you can do the ssh key dance, plink will support it via puttygen. Someday, when I get around to doing it, I will write a tutorial about this.

About these ads

Actions

Information

2 responses

25 03 2009
links for 2009-03-25 at adam hoyle presents suckmypixel

[...] Blackberry development on Mac OS X « Software Nuggets Working with Blackberry SDK in eclipse on a mac, while testing in windows running in Parallels (tags: programming tutorial eclipse development blackberry) [...]

6 11 2009
Greyson

Just thought I’d note that you don’t need to do this auto-discovery. There is a static symlink to the drive, wherever it’s mounted in (in my case) “~/Library/Parallels/Microsoft Windows XP/Windows Disks/C” to which you can copy as long as Parallels is actually running.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: