how to blackberry application on simulator using command prompt? - blackberry

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.

Related

Communicating with an iOS device connected to an OSX VirtualBox VM

I am a tester writing cucumber test scripts using a Calabash/Ruby solution.
Here is my setup. I have two iOS devices plugged into a mac-mini. I have Xcode running and connected to a physical device. I also have an Oracle Virtualbox VM running on it that has another copy of Xcode running and that VM has another physical iOS device connected to it.
My dilemma is this. What I need is to write one test scenario that can test communication like calling and text between the two...so from within that test scenario I need to find a way to switch between the two devices.
I have been able to successfully write cucumber tests for Android doing this by adding special tags in the app_installation_hooks file. I referenced this link.
I have an idea it involves redefining the BUNDLE_ID, DEVICE_TARGET, and DEVICE_ENDPOINT every time I switch to a device, but I'm not sure how to write that if that is the solution.
I'm currently executing just one of my tests by calling 'bundle exec cucumber' which I can do on both machines (phsycial and virtual) individually.

iOS unit testing on a Mac running Mountain Lion (OS X 10.8.5)

I have an iOS project that comes from an older Xcode (4.6.3) and that did not include a test target by default, as projects in latest Xcode versions seem to include. I now have Xcode 5.1.1. on a Mac that is running OS X 10.8.5. I've reading this Apple's document regarding unit testing in Xcode, but it looks like you need OS X Mavericks, at least for installing and configuring OS X Server, don't you?
I'd appreciate some guidelines to follow to add a test target to my project and how could I integrate a testing process in my workflow if I do not have OS X Maveriks.
Thanks in advance
EDIT: Is there anyway of run tests in normal running of the app? I mean, I need to test some cases that involve the update of data at certain hours, and the update of some parameters and the GUI after that data update... how could I do this? Thanks
You need Mavricks if you wish to use the Xcode service, which is Apple's continuous integration server. You do not need Mavricks to run unit tests, however you will miss out on the pretty in-xcode reports.
Without Mavericks, you can run unit tests manually by pressing CMD+U or going to Product->Test.
You can also setup your own continuous integration service and run the unit tests with a command line script. You'll have to pick a CI server, something like Jenkins or many alternatives, and look up a how-to for that system.
Do you redirect NSLog/stderr anywhere?
I encountered this problem too with no red marks and failing test of '1 == 1'.
My app was catching NSLog calls to a file and not letting the system get them. Once I disabled the redirecting of logs freopen(filepath, "a", stderr) test started passing and green checks and red crosses appeared.
I did this for an external accessory device that hooked up through the lightning port and couldn't send the logs to the mac. You mentioned how you want to run the test during the normal running of you app, so I figured you may have saved the logs so you could read them away from you mac.

How do I automatically create performance reports for an iOS app?

For some of my iOS application projects, I would like my CI server to be able to report the following properties:
startup time
frame rate
both as a graph over time, and with "low water marks" so the build fails if the measured results aren't within certain criteria. I've already found some of the things I need.
The CI server will be Jenkins.
I can use Transporter Chief to get the built app onto an iPad.
To measure the startup time I could find the duration between launching main() and leaving application:didFinishLaunchingWithOptions:.
To measure frame rate I can put a CADisplayLink into the app and sample its duration property.
If those tests output JMeter XML, then Jenkins can display the output via the Performance plugin.
What I haven't worked out is, how should I embed those tests into my app and launch it on the iPad? As described above I can deploy the app to the iPad, but then I don't know how I would launch it to gather the results of the tests. My unit tests are running on the simulator - I don't want to run the performance tests there obviously :-).
I imagine that there's a solution involving jailbreaking the iPad and controlling the app over SSH, I'd prefer not to go down that route if it's possible. If you have done that and can explain how it works, I'd still like to hear about it.
I'm also using fruitstrap to install apps on the device in CI. In terms of booting the app, I know of two ways:
Use fruitstrap with the debugger attached
I know teams that have done this to run KIF integration tests on devices in CI. I have played around with fruitstrap to get it booting apps on the device, but haven't myself taken the extra step of automating the whole thing
shameless plug for my post on fruitstrap: http://www.stewgleadow.com/blog/2011/11/05/installing-ios-apps-on-the-device-from-the-command-line/
Use the instruments command line tool with UIAutomation
I know the instruments tool can boot apps on the device automatically in CI (I wish it also installed them, but we have fruitstrap for that until Apple fixes it). So you could write a really simple little UIAutomation test that gave your app enough time to do its performance analysis.
Jonathan Penn has a nice little demo project for UIAutomation and build script that could be integrated with an 'install' step using fruistrap to try it out on the device
In both cases, I uses a little wrapper around libusb to give me the device ID of attached devices, so the more devices I plug into my CI machine, the more devices it runs tests on, https://github.com/sgleadow/iphone_detect
Can you launch the app on the device using lldb?
If so, it may also be able to capture the log output.

iPad writing custom apps and scripts

I have an iPad 1 with redsn0w jailbreak.
I have a little experience writing html & php and I can find my way around the command line on a Linux machine. I use PuTTY to connect to my iPad, and iOS seems to be very Linux like.
I am wondering about writing custom scripts and apps for the iPad. I did some search on Google and here on Stackoverflow, but I have come up with a blank (perhaps I am searching for wrong terms).
So on to my actual questions...
Question #1
Are there any free development platforms that let you develop and test apps for the iPad?
Question #2
Are there any free scripting languages available that will run from the iOS shell?
XCode is free, but you'll need a mac. If all you're doing are web apps, there's no need for any specific compiler like XCode, so you can obviously do your development on any machine in Vi, emacs, notepad, or whatever you want.
According to this post you'll need to install MobileTerminal and some other shell utilities to do any decent bash shell scripting.
My own advice: save yourself a boatload of hassle and invest in a used Mac Mini on craigslist and get xCode for free and you can do all the custom (and far more capable) programming for your iPad that you could ever wish for.

application wont start or load in blackberry simulator

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

Resources