Blackberry Simulator is a Time-Burglar?


Blackberry has done an excellent job designing the Blackberry simulators that come with the Eclipse plugin. Testing and debugging is really a breeze once the simulator is running. The only problem I have with the tools that Blackberry supplies is the length of time it takes for the simulator to start. I'm not running the tools on a slow machine either - My setup is a new Mac Mini - 2 GHz Intel Core 2 Duo - with upgraded 7200RPM hard drive and 4GB of RAM, running Windows 7 64-bit in the Bootcamp partition. Although I have VMWare fusion on Leopard, I still boot directly into Windows 7 since Fusion seems to run Win7 pretty slow.

I timed the startup of the simulator and it takes a full 35 seconds to boot the device to the home screen while it takes 55 seconds with the debugger attached. Unfortunately, you cannot load changes to the code dynamically into the simulator - at least I haven't been able to find a way to do this. So you know what this means - every time you want to test your code you have to wait 35-55 seconds for the simulator to start then locate your program in the device and click it to run.

To make matters worse, the close button on the simulator doesn't function and you cannot easily start a new simulator when one is running. The only solution is to keep the Windows task manager open at all times and use it to shut the simulator down. I did some investigation when I first started programming for Blackberry and haven't found a solution for this issue anywhere.

It may seem that I'm complaining about something minor but when you stop and think about the time waste of sitting and waiting for the simulator to start over the course of developing an app, those chunks of 35-55 seconds really start to add up. While programming it's common for me to run the simulator 5-10 times an hour. Staying on the conservative side, lets say 5 times an hour - 5 x 35 /60 means you're wasting almost 3 minutes each hour sitting and waiting for the simulator to start. Multiply this x 10 hrs of work each day means 30 minutes of your time is wasted each day doing nothing - just twiddling your thumbs waiting for the simulator.

Given these estimates, I'd say that on the last application I wrote a full day(24 hours) was wasted waiting for the simulator and that's not even counting the extra time it takes for the debugger to start! The only thing you can do to speed up startup each time is to escape the Setup Wizard when you first run the simulator of choice, or for every simulator you use. This will prevent the Wizard from running saving you a few seconds. Unfortunately, my timing of startup includes this "optimization" so don't expect anything faster.

14 comments:

Unknown said...

OMG! And I thought I was the only one complaining about the wait. I am a beginner, so I like to test every small but of code as and how I write it before there are too many errors in a length of code and it become difficult to understand which part of the code the error is really referring to. I so wish I didn't waste so much time.

John Banks said...

Hi Anindita. You're not the only one complaining - testing out the code regularly is something I am a big proponent of since it will eliminate errors in the long run. In particular when I modify the UI elements I always run the code on the simulator to ensure what I'm expecting occurs on the device as expected. Unfortunately we'll have to learn patience since it doesn't seem that Blackberry will be upgrading the tools for Eclipse any time soon.

Unknown said...

Yeah, the simulator takes rediculous amount of time to load. Closing is often bugged too. The work around I did was to make a .bat file that kills the simulator.

taskkill /F /IM java.exe
taskkill /F /IM fledge.exe
taskkill /f /IM BbDevMgr.exe
taskkill /F /IM conhost.exe
taskkill /F /IM cmd.exe

I called it KillSImulator.bat. This file works like a charm.

Unknown said...

I suggest you cross-compile to the JDE for debugging. It's way faster to load the debugger, which is what takes the bulk of the time on Eclipse.

John Banks said...

@Chris: I tried to avoid using the JDE since I really like Eclipse (maybe better to say that I'm more familiar with Eclipse). Since there hasn't been any improvement since I wrote this article I'd tend to agree with you that your idea is the only real solution.

Anonymous said...

I'm a relative newbie to BB development, so what I'm suggesting may not be what you're looking for. In any case, unless you want to run in Debug mode, you can Load the latest java program (cod) via File -> Load Java Program from the Simulator menu after "running" the program again (Ctrl+F11). This will bring up a File Picker where you can select the latest cod file from the default directory (i.e. C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.6.0_4.6.0.19\components\simulator). This should replace the java program already on the Simulator with the latest one without having to restart the Simulator.

As I already mentioned, I'm not sure why this doesn't work in Debug mode (probably because the Debug Server is getting in the way). If anyone figures out how to do something similar in Debug mode, then it'll save me a lot of time.

- Jin

John Banks said...

@Jin: Thanks for that tip, I'll update the post with your suggestion after I test it out and in the meantime I hope it helps people out there. I wish there was some fix for Debug mode but since I run the simulator way more than debugger this should be a big help. Appreciate it!

Anonymous said...

@Jin! thx that works for me!
- mapet

Anonymous said...

I totally agree, I'm a designer testing designs in the simulator an a little bit of development stuff and it is an absolute killer. I hate it!

John Banks said...

@Anonymous: I wrote this post awhile ago and the tools have actually become ever so slightly improved since then. Nonetheless, they're still slow as compared to Android/iPhone tools but since they're free I guess we can't complain TOO much :)

Anonymous said...

@Jin

Thanks so much, I was going insane with the amount of wait time. This post is quite old but i'm really glad i found it! Thanks for the post John.

-hk

Scotter said...

There were times I've seen it take over 3 minutes to start! My iPhone and Android projects got done in 3/4 the time or less!

One trick I discovered is to rename your application every time you build it. I was working on an app called "LISI", each build I'd name the output file something different like "LISI_10", then 11, 12 and so on. Every 10 builds I'd delete the old ones because it was making the 9800 simulator run out of area and the desired app was getting hard to find! But at least I didn't have to restart all the time.
Now... once you start using things that are "sticky" on the device/simulator, such as persistence, then the gig's up and you can't pull the new-name-each-time trick because you get a duplicate class definition error. Otherwise it worked great.

Anonymous said...

I just compared Blackberry JDE 6.0 with Blackberry Java Plug-in for Eclipse 1.3 MR and I didn't find out that Blackberry JDE is faster than the Eclipse.
At both IDE, it takes about 35 seconds for the simulator to load up the home screen. It is about 2 minutes for debugging. At both Blackberry and Eclipse, it uses the same simulator so it seems to me that it makes sense that they are about same time here. Is there anything special to do to speed this up at Blackberry JDE?

Anonymous said...

Have been doing BB development for a few months now. It's not just the so-called simulator. Everything about BB development sucks. APIs that don't work properly, poor documentation, hardware that runs slower than the simulator, hardware that doesn't work as expected, stupid signing that sometimes works and sometimes doesn't. Oh, and did I mention that the APIs are rubbish? It's just poor and the sooner RIM goes bust the better.

Post a Comment

top