Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
gxgraham
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320
Accepted Solution

Refresh Eclipse + Simulator after changes.

The only way I have been able to have the simulator load my most recent changes is to close the simulator and then click Run As, Blackberry Simulator and wait for it to load everything again with the updates.  Is this the way this works or is there a quick way to refresh the simulator with the most recent changes without closing it.

 

Thanks in advance, 

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Refresh Eclipse + Simulator after changes.

If there's a faster way I'd love to know about it.  Otherwise, it's just a matter of restarting the simulator every time you want to run new code.  In my experience, the only thing that helps here is to have a fast machine - and I'd recommend having at least 2GB of memory.  I used to have 1GB but if I did anything on the machine besides Eclipse and the simulator then the simulator would take minutes to load up and run.  With 2GB everything is relatively snappy.
Please use plain text.
Administrator
MSohm
Posts: 14,404
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Refresh Eclipse + Simulator after changes.

This is the correct procedure for testing a new version of a Java application in the BlackBerry Simulator.  The BlackBerry Simulator should be restarted.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Refresh Eclipse + Simulator after changes.

Here's an ANT task that I use.  Works for most situations.

<target name="sim.load" description="Simulator loader">
<exec executable="${rim.jde.home}/simulator/fledgecontroller.exe"

osfamily="windows" vmlauncher="true" failonerror="false">
<arg value="/execute=UsbCableInsertion(true)" />
</exec>
<exec executable="${rim.jde.home}/bin/javaloader.exe" dir="build/output"

osfamily="windows" vmlauncher="false" failonerror="true">
<arg line="-u load ${unix.project.name}.cod" />
</exec>
</target>

BTW, If you don't have the simulator running but do have a device connected, it'll push to the device.

 

Please use plain text.
Developer
gxgraham
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320

Re: Refresh Eclipse + Simulator after changes.

Your ant task works slick.  ... It does appear to be kicking the simulator out of debug mode.  Have you seen any way around that? 

 

Thanks, 

Please use plain text.
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Refresh Eclipse + Simulator after changes.

That's why I said "most" situations. :smileyhappy:

 

 

<target name="sim.load2" description="Simulator loader"> <pathconvert property="codfile" dirsep="/"> <path location="${basedir}/build/output/${unix.project.name}.cod"/> </pathconvert> <exec executable="${rim.jde.home}/simulator/fledgecontroller.exe" dir="build/output" osfamily="windows" vmlauncher="true" failonerror="false"> <arg value="/execute=LoadCod(${codfile})" /> </exec> </target>

 

 Try this version.  It doesn't reset the debugger but if the module being replaced is in use, you'll have to reset to get it back.

 

Fledgecontroller doesn't line '\' in a LoadCod path so there's a pathconvert task first to make sure the path to the cod file has '/' for path separators.

 

 

 

 

 

Please use plain text.
Contributor
dsailer
Posts: 25
Registered: ‎02-19-2010
My Device: bold 9700
My Carrier: att

Re: Refresh Eclipse + Simulator after changes.

I'm using this ant task and have found that sometimes I get "unable to open port". Also, it will work the first time I redeploy but on subsequent runs the simulator doesn't pick up the updated code.

 

Any ideas?

Please use plain text.