how to blackberry application on simulator using command prompt?
Is ther开发者_JAVA百科e any tool in blackberry sdk like adb in android which can be used to install or run apps from command prompt on simulator.
Once you've packaged a .cod file to deploy, you basically have two options, which Howard and seand mentioned:
- Using javaloader:
javaloader -u load <path-to-cod>.cod
- Using fledge and fledgecontroller
I'm guessing based on your question that this is part of an automated deployment scheme? I'd recommend using javaloader when deploying to real devices, and using fledge/fledgecontroller for deploying to the simulator.
javaloader will require that the simulator is simulating a usb connection, and a lot of people seem to have had trouble getting it to work correctly - when we tried there was about a 50% chance for any given run that it wouldn't connect or deploy correctly. But it works a bit better when trying to connect to a real device, at least in my experience. And if your project and requirements are fairly simple, you might be able to get away with using it on a simulator without too many problems.
Fledge/fledgecontroller have more commands that are useful for doing automated deployment and testing, which is primarily why I recommend them. They are a bit more complicated to use, however. To deploy to the simulator with fledge and fledgecontroller, you'd want to do the following:
- Start fledge (located in the simulator folder) with
fledge.exe /handheld=<handheld-id> /session=<session-name> /app=<simulator-folder-path>/Jvm.dll /automate
- Use fledgecontroller (also located in the simulator folder) to load the cod with
fledgecontroller.exe /session=<session-name> /execute=LoadCod("<path-to-cod>.cod")
<handheld-id>
is the id of the device you want to test on - e.g. "8300" would run the 8300 simulator for BB 4.5
<session-name>
can be anything, but should match between the call to fledge and the call to fledgecontroller
Note that it will take a little bit of time (anywhere from 15 seconds to 5 minutes, depending on which simulator you are using) for the simulator to boot after calling fledge. You'll need to wait for it to finish before calling fledgecontroller.
Fledge also has a bunch more commands that you can use to configure the session, for example by setting up an sd card or language options. If you run fledge.exe /help
, it will describe the different parameters; and fledge.exe /controller-help
will list the different commands you can pass through fledgecontroller.
In summary: if you are using real devices, or possibly if you are doing very simple deployments on a simualtor, you can probably get away with using javaloader. If you want more control over the simulator, you should use fledgecontroller.
Most probably the JavaLoader is the tool you are looking for.
Simulators are launched using the 'fledge.exe' CLI tool. Look at the built in scripts for launching simulators to see the myriad of options.
精彩评论