As I recently blogged, I just started working at Rdio. Specifically I’m working on the Android app. A fair amount of code is shared between our Android & Blackberry app (since they both use a common platform of Java). Since I’ve been making changes to the Android code, I wanted to be able to build the Blackberry app to make sure I didn’t regress or break anything there.

I’ve got a shiny new MacBook Pro, and well… it just feels like sacrilege to be running Windows on this thing. So I set out to see if I could get the latest Blackberry SDK working on OS X. And… well, it works! Requisite screenshot:


I owe a huge amount to this blog post, which I used and simply updated and hacked around with the latest rev of the SDK… I can’t claim much creativity for my steps since it’s clearly a derivative of azizuysal’s work.


SDK & ant Setup

  1. Install Eclipse wherever.  It doesn’t matter where.
  2. Create a Blackberry directory for your Eclipse workspace and to hold the SDK.  I used /Users/stevel/ws/Blackberry.
  3. Launch Eclipse and specify that directory (/Users/stevel/ws/Blackberry) as your workspace directory.
  4. Launch a terminal and do the following:
    1. mkdir $HOME/ws/Blackberry/SDK
    2. cd /tmp
    3. unzip $HOME/Downloads/ mpp-sdk/osx/preverify/preverify
      unzip mpp-sdk/osx/preverify/preverify
    4. unzip $HOME/Downloads/BlackBerryJDEPluginFull1.1.2.201004161203-16.exe
      1. (this will create two directories: InstallerData & Windows)
    5. unzip InstallerData/Disk1/InstData/ “C/ABS10/Components/EclipsePlugin/1.1.2/EclipsePlugin/installer/InstallAnywhere/InstallerData/EJDE\ Plugins1ae15a8ca04czgiasf.jar”
      1. (this will create a retardedly long subdirectory path, as you can see)
    6. unzip C/ABS10/Components/EclipsePlugin/1.1.2/EclipsePlugin/installer/InstallAnywhere/InstallerData/EJDE\ Plugins1ae15a8ca04czgiasf.jar
      1. (this will create two subdirectories: features & plugins)
    7. rm -rf C_ InstallerData Windows features
    8. cd $HOME/ws/Blackberry/SDK
    9. mkdir net.rim.ejde.componentpack5.
    10. cd net.rim.ejde.componentpack5.
    11. unzip /tmp/plugins/net.rim.ejde.componentpack5.
    12. mv /tmp/mpp-sdk/osx/preverify/preverify components/bin
    13. chmod +x components/bin/preverify
    14. cd ..
    15. mkdir bb-ant-tools-1.2.8-bin
    16. cd bb-ant-tools-1.2.8-bin
    17. unzip $HOME/Downloads/
    18. rm -rf /tmp/plugins /tmp/mpp-sdk
  5. Now go back to Eclipse, and go to the Eclipse>Preferences menu
  6. Go to Java>Build Path>User Libraries and click New
    1. Enter “Blackberry 1.1.2″ as the library name.
    2. Click Add Jars and select $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.
    3. Then select Javadoc location and choose the $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5. directory
  7. Go to Ant>Runtime in the Eclipse preferences
    1. Under Global Entries, click Add External Jars
    2. Choose $HOME/ws/Blackberry/bb-ant-tools-1.2.8-bin/bb-ant-tools.jar
  8. Click Okay and save the Preferences
  9. Add $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5. to your PATH via your .bashrc file

Building Hello World

  1. Follow the exact steps (heck, use his sample code) in the blog I linked to above.  It works perfectly.
  2. Only hitch is make sure to update the jde.home & simulator.home properties in your build.xml to the right paths of course.

Running the Simulator

  1. Call me nuts, but I didn’t feel like install MacPorts.  Instead, I built my own Wine from source.  To do this, just follow the instructions here.  I installed it to /usr/local.
  2. Grab winetricks and put it somewhere in your path (curl > $HOME/bin/winetricks)
  3. Install various winetricks packages:
    1. gdiplus msxml3 msxml4 msxml6
    2. (yes really, I had to install all 3 for some reason.  I have no idea why)
  4. cd $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.0.0_5.0.0.25/components/simulator
  5. cat 9550.bat | sed -e ‘s/^M//’ >
    1. note the ^M isn’t a literal ^M, it’s the ctrl code for <Return>, hit Ctrl-V and then the Return key to generate it.
  6. Edit the file and make it look like:
    1. #!/bin/sh
    2. cd “dirname $0
    3. /usr/local/bin/wine fledge.exe /app=Jvm.dll /handheld=9550 /session=9550 /app-param=DisableRegistration /app-param=JvmAlxConfigFile:9550.xml /data-port=0x4d44 /data-port=0x4d4e /pin=0x2100000A
  7. Fixup the 9550.xml file
  1. cat 9550.xml | sed -e ‘s/^M//’ > /tmp/foo
  2. mv /tmp/foo 9550.xml
  • chmod +x
  • ./
  • You’re done!  You can load your .cod files by using the File>Load Java Program menu in the simulator
    1. No Trackbacks to “Building & simulating Blackberry apps with the Blackberry SDK on Mac OS X”

      4 Comments to “Building & simulating Blackberry apps with the Blackberry SDK on Mac OS X”

      1. nonom Says:

        Excellent instructions. I would make one suggestion- get preverify from Motorola [1] instead of mpowerplayer. The one from mpowerplayer is compiled for powerpc and needs Rosetta to be installed, whereas the one from Motorola is compiled for intel.


      2. Eric Arseneau Says:

        Following these and other instructions has gotten me to be able to run the Simulator. However, the graphics are all wrong, the screen tends to go black and the hourglass icon in middle looks like random chunks of memory.

        I am running on 10.6.4, Mac Book Pro i7, JDE 5.0.0. I installed wine-devel (1.3), also same issue with 1.2, instead of building it all from scractch, using macports.

        Anyone else run into problem where the graphics are wrong/garbled?

      3. Eric Arseneau Says:

        I GOT IT TO WORK!!! Turns out the version of X11 I had, the core one from Apple was old? I am able to run Wine and the Emulator with the same exact wine setup, but with XQuartz 2.5.3, which was confusing for a bit as the Apple X11 is version 2.3.5 :) Thank you all for posting these up.

      4. Blackberry development Says:

        Excellent Idea.!Following these instructions has gotten me to be able to run the Simulator.Thanx for great post.

      Leave a Reply

      Recent posts