BlackBerry Simulator in Linux - Sort of

Call me crazy but I just can’t seem to accept that if you want to (or have to) write BlackBerry software you’re stuck with Windows. It bugs me.

There is good news and bad news regarding the simulator. The good news is with a recent version of Wine you can actually get the BlackBerry simulator to run. The bad news is that it’s a bit buggy, and debugging hardly works at all.

What to expect

Your millage may vary! Generally I find that the simulator is usable for most testing. Attaching a debugger to it (via JDWP) just seems to cause the simulator to hang. Mind you, I have a rather slow system (AMD XP 2500+) and I would love to hear about your experiences if you have a faster computer.

Ingredients

Wine - You need the most recent version you can get your hands on. The package in the Ubuntu repository won’t due. So if you have installed this one, remove it and follow these instructions to get the latest and greatest.

For some reason until I performed the following steps, the simulator would always crash on startup:

rm -rf ~/.wine

Start up winecfg

Applications tab - select Windows 2000 from the dropdown list

Audio tab - select ALSA Driver from the drivers list

It should go without saying that you will need a copy of the JDE or one of the simulator packages. If you have access to a Windows box, just zip up the JDE or simulator and copy over. Otherwise, there are a few tricks to extracting the contents of the setup package.

Extract the setup package:

$ wine BlackBerry_JDE_4.2.1.exe /extract:c:\\

Which extracts the files to ~/.wine/drive_c/

Use msiexec to install the package:

$ wine msiexec /a c:\\jde_installer.msi /qn

Which extracts the file to ~/.wine/drive_c/Program Files/Research In Motion/BlackBerry JDE 4.2.1. This is a cumbersome path at best so move this somewhere more usable:

If you copied the JDE from a Windows box you might need to update other files. You must also remove Settings.rc if it already exists.

Make sure you have the Sun Java Runtime installed by running java -version. Now all that’s left is to start up the JDWP:

$ java -jar JDWP.jar

On startup, there will be an error message about RIMUsbJni.dll but you can safely ignore this. And that’s just about it; your JDWP client connects as usual (jdb, eclipse, netbeans). Feel free to leave your successes/failures in the comments.

Comment submitted

Thanks! Your comment will be reviewed shortly.

jiGGaK
July 16th, 2012

Last time I was doing bb dev was about 2-3 years ago. At that time not much had changed on the linux front. The barry project has continued to progress and the bjavaloader tool still works great. Last time I checked the simulator was still hit or miss with wine, but networking in VirtualBox has got a lot easier so running the simulator in a virtual machine is pretty straight forward.

Has this gotten any easier? Have you tried this with newer Linux’s? I see this is a long time with no comments…

Iordan
January 21st, 2011

Hi guys,

When I run BlackBerry Simulator 6.0 with Wine 1.1.42, I get screwed up graphics. However, turning Graphics Acceleration off fixes this. You can do this by clicking View->Graphics Acceleration->Off However, I also get:

Andrey
April 5th, 2009

Hey, awesome tutorial,
I was just wondering, do you have any way of getting eclipse to work? This is somewhat outdated however, most of the steps worked. Oh, I’d like to add the “thank a lot”, for the tutorial. I’m using wine 1.1.2

Jason
November 23rd, 2008

Has anyone had more luck getting the newer JDK 4.6 version of the simulator to run in wine? When I try using winetricks to install gdiplus and msxml3, I still can’t get it to work.
I get the following errors:

I’ve been at it time and again and I can’t seem to run rapc.exe from Linux or OSX! I’m not using rapc.jar directly because according to RIM the exe passes some secret but necessary values to the Jar. I went the path of invoking the jar directly but ultimately ended up with sporadic application crashes and preverify errors. From what I’ve learned all of the tools (except for the SignatureTool.jar) need to be at a version level equal to or lower than your target or you’ll be subject to random application failures and undefined behavior after compiling. Rolling my tool set back to version 4.2.1 almost forces me to use Windows because it (older rapc) relies on preverify (NOT preverify.exe) and javac being located in the PATH which means I have to wrapper preverify.exe with a shell that calls it under wine. (This much does work but is extremely painful.) There’s more to the story that I plan to post to my site soon.

Fred
July 7th, 2008

I managed to extract the phone “plastic” image and invert it (vertically) and then copy it back to the fledge.dat (zip) file. The plastics image files are in the /res/plastics/ folder in this zip file. That solved that problem.

The LCD display is messed up when the simulated trackball is moved. That may be a problem with the flash player I’m using, but I can’t tell.

jiGGaK
July 7th, 2008

Fred,

I have the same problem with the 4.5.0 simulator and I haven’t found a way to make it work. It seems using an earlier version is the only option.

Fred
July 6th, 2008

I can get the simulator to run, but the phone image is upside-down and backwards, while the LCD image is correct.

Any idea what’s wrong or how to fix this?

wine-1.0-1.fc8 & LDE 4.5.0

Fred

Mack
April 17th, 2008

Hi:

I’ve follow up your howto but the simulator don’t work, I’ve try it few times, but I got a few errors message like:

Access violation reading from 0x00000024

or the simulator init but it frozen when the Media Card Inserted message appear.

I’ve wine 0.9.58 en JDE 4.2.1

I’ll appreciate your help.

Regards

jiGGaK
April 3rd, 2008

Paul,

Are you serious? Go over to the post about the MDS simulator… there is a script already written for you, just copy/paste!

And use the comments section over there for issues related to MDS please. Thanks.

Paul
April 3rd, 2008

Ok, I’m of the noob variety. How to I convert the following to run as a shell script in Linux? … (or do I?)