I am just entered into the Blackberry Arena..
I am using Eclipse Plugin for running my testing application to simulator.
So, In my code somewhere I have add System.out.println("Print"); statements, but by debugging or running app to simulator, I couldn't find any log statements printed to eclipse console.
Is there anything that I need to take care for using println() methods ?
First it is not enough to "Run" your app, you have to "Debug" to see the output. Second you need to make sure your eclipse console is set to "BlackBerry Simulator Output Console".
Once you've done that you should be able to see a whole lot of log statements, most of them from BlackBerry but yours should be in there too.
Run it in debug mode in the BlackBerry simulator. It'll be there, unfortunately there will also be a ton of BlackBerry print statements mixed in.
Related
I'm running dart with this command:
dart run --pause-isolates-on-start --observe --enable-vm-service=8181/0.0.0.0
With this command, can open on browser the dart native user interface to debug on
http://<ip>:8181/<authentication-code>
On debug page, is possible to set breakpoints and use them. But I don't find a way to save the break point to use on a future loading of dart debug.
Every time that I start the debug i have to set this breakpoints?
There is a way to save this break points to use on the future?
Not necessarily the answer you are looking for but could be seen as a workaround.
I have not tested this with VS Code, but if you are using IntelliJ (or Android Studio) with Dart plugin, you can essentially do remote debugging. So instead of using observatory to insert breakpoints, you can set them in your IDE which will then remember them and resend them to the Dart process when start debugging again.
If you go into "Run/Debug Configuration" and click + (Add), you can find "Dart Remote Debug":
As described in the dialog, when you are starting this "Run profile", you will be asked for the address to the Dart service protocol which your application should print out when started with Observatory / Dart DevTools enabled:
Unrelated notes
I have spend some time look at vm_service package which does provide ways to fetch breakpoints and adding breakpoints. But it is not really easy to map the breakpoints into something that can easily be persisted and later resent again. Some links you can use if you want to go for that journey:
https://pub.dev/documentation/vm_service/latest/vm_service/Isolate/breakpoints.html
https://pub.dev/documentation/vm_service/latest/vm_service/Breakpoint-class.html
https://pub.dev/documentation/vm_service/latest/vm_service/VmService/addBreakpoint.html
https://pub.dev/documentation/vm_service/latest/vm_service/VmService/addBreakpointAtEntry.html
https://pub.dev/documentation/vm_service/latest/vm_service/VmService/addBreakpointWithScriptUri.html
I create a hybrid app using apache cordova and I want to run some test using APPIUM (pytest).
Can I use the app build or the debug build for testing?
I really don't know what is the effect if I use the two different builds.
Thank you!
One is built in Release mode and one in debug mode. Now, it depends on you if you are using any tools that catch the logs generated by the app.
In release mode, you cannot get the app's logs, in debug mode you can get the debug logs.
For ex, if you wanna make sure that one particular set of the code block is executed, the developer can put a line of code which writes into log-like 'This code block is executed' etc.
It's best that you use debug since sometime an android app having pro-guard enabled may cause some problems for automation.
Debug build is recommended for testing because the complete symbolic debug information is emitted to help while testing applications because the code optimization is not considered.
Is there 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.
I'm developing an application on two different machines (home and work) and while the home one seems to run just fine, the work one is, for lack of a better word, possessed. It has been exhibiting the following issues:
When loading the application, it will start at the simulator's main screen instead of starting the application at random intervals. You can start the application and have it work fine, then close the simulator, reload, and have the same codebase not load.
Going to applications doesn't show the application itself, in fact it never does.
Trying to load the applications cod file (File->load java program) never works. Tried the steps in this thread, with unreliable results.
Extremely small changes, such as modifying the value of a width variable by one, commenting out a function such as makeMenu or adding a button will cause code to no longer work, with no errors shown by the IDE.
Using clear.bat with sometimes work, sometimes not. Same with manually removing all files with the name of the project.
reinstalling the eclipse environment and the blackberry plugin did nothing more then burn off an hour.
having "load on startup" in the blackberry_app_descriptor.xml file is set.
Both systems are using Eclipse 3.5.1, BB plugin for eclipse 1.1 beta, Java 4.5 with the 8300 simulator. THe only difference that I am seeing is the operating system between the two systems. The work one being XP Sp3, home being vista. THe vista one isn't perfect, but I can test variable changes without flipping a coin to see if the app will even load or not.
I've tried the solutions that were similar on this forum, such as this one, but it looked to be that those solutions are dated as none of the options for the steps existed in my eclipse install.
So has anyone ran into such baffling behavior, and can it be fixed? Anything that I might have missed that could be tried?
I've been seeing this behavior with the new 1.1 plugin, the application doesn't load on startup and the FIle->load java program doesn't help. For me, the solution was I have to run a clean build every time, that is the eclipse clean and build instead of just build, not the clean.bat... Hope this helps!
Try clearing resources that have improper naming structure in your projects stuff with spaces or special character in the name of the file.
It took me two days to figure out.
One solution i got regarding your problem.
As I See Please run the application first time as Run as blackberry simulator
that is got start and here pick up run and then Run as Blackberry simulator
We are trying automated builds using Flash CS4, and every once in a while the IDE will crash, and we want it to just keep on running then - but instead it halts on the crash reporter and we need to actually log into the server and click "Cancel" manually.
I can't find a setting and nothing on Google - any ideas?
Thanks!
I think this is an OS setting, and not a Flash CS4 setting, or is it?
In Windows XP you can configure this in your control panel: http://www.techtut.com/Tutorial/Windows/44-Disabling-Windows-XP-crash-report.html
In OSX you have to run a couple of terminal commands (or install a utility): http://www.macosxhints.com/article.php?story=20090902164105138