How to launch an application in Blackberry simulator through command prompt - blackberry

I want to open the simulator, load the cod file and run the application in Blackberry simulator through the command prompt.
I'm able to open and load the file to the simulator using fledgecontroller commands, but not able to launch the application. Could anybody please tell me how to launch the application from cmdpmpt ? Is there any fledgecontroller cmd for the same ? Please advise.
Thanks in advance..!!

This is tricky question.
You have three options:
Should work 100% - Make your app autostart. If you're using bb-ant-tools search for runonstartup parameter. Don't forget to wait in application until 'device' is fully powered up (ApplicationManager.inStartup())
Not 100% working - Put the app position to jad file on home screen and after say fledge to navigate to specific position on home screen and tap it. If you're using bb-ant-tools search for ribbonposition parameter. But this is valid for simulator version less than 6. I think system ignores it for 6+ OS
Didn't try myself yet - Start search and type application name and same steps with navigation from previous case
Are you trying to setup acceptance tests?

Related

App do not run on second Simulator?

I am trying to run a app on multiple simulators. I did manage to run 2 simulators see link Xcode6: Run two instances of the simulator.
I can run other apps on the two simulators. I did manage to run this app on the two simulators in the past.
For some reason when I try to run a second simulator there is a pause I can see IOS system log trying to open the it just closes.
I searched the IOS Log file found that both simulators have the same data (unhelpfull). I would appreciate it if someone can just point me in a direction where to start searching for the problem?
My Mac memory is fine do not have to few. The start file is also not have anything I can see that might cause this problem.
Thanks in advance.
My problem was localisation that is why the add did not run on default english setting. The add worked correctly throw Xcode because the Sceme helped set the language.

How to debug iOS 8 extensions with NSLog?

- (void)viewDidLoad
{
NSLog(#"%s", __func__);
// ...
}
in viewDidLoad of an iOS 8 extension. the NSLog outputs nothing in Xcode. NSLog works as usual in the container app though.
How can I get output from debug messages from an extension?
Debugging works for app extensions.
It works on simulator too.
If your app ext crashes in the simulator, you may find it is not easy to restart your app ext. Restarting your simulator is a quick solution.
Steps to debug an app extension:
Run the container app. In this step, Xcode uploads the container app and app extension to the device or simulator.
Stop the container app. This step is important when you debug in simulator. If you don't do it, Xcode will tell you the simulator is in use.
In Xcode, press menu Debug -> Attach to Process -> By Process Identifer (PID) or Name..., input the app ext's identifier, e.g. com.abc.ContainerApp.MyExtension, to start debugging. Don't forget to set break points. (Update on Aug 25, 2014: you can input MyExtension(your extension's name) directly.)
In the device or simulator, open your app extension.
Updates on Aug 23, 2014:
I found the debugging steps above do not work well on Xcode 6 beta 6 with iOS 8 SDK beta 5 on the simulator.
Solution:
Run your extension in the simulator.
Xcode menu Debug -> Attach to Process -> Choose "MyExtension(your extension's name)" in System section in the menu.
The breakpoints work. But I don't know why logs do not show in the output window.
I'm having this problem too. It works for me if you go in your Simulator under the menu Debug -> Open System Log...
From here you can see all the logs of the iPhone Simulator (included your extension's logs).
NSLog is working perfectly.
You just don't see what is being logged in the debug area of Xcode because the Xcode debugger isn't attached to your extension. Extensions are nearly completely independent from their containing app. They have separate bundle identifiers, for example, and they also are separate processes on the OS.
I have had varied success in getting Xcode to attach to extensions. Supposedly it seems it would attach automatically, and it appears in the debug navigator as "Waiting to attach", but never attaches.
Sometimes, I am able to run my extension target in Xcode:
And then have the option to choose what application to run my extension in. In this case, I would choose its recommendation of "today", which is notification center.
And then it would sometimes attach the debugger to my extension. Note this method only works on physical devices, it seems.
If it doesn't attach you can use the manual attachment method in #VinceYaun's answer,
I have also had varied success using other methods of attachment. Most have been unsuccessful, and it seems they are just bugs that will be fixed at a later date.
To view your log messages you go to Window -> Devices in the top bar and select your device. You can bring up the device log from the bottom of that window. If you are testing on a simulator, you can use #BalestraPatrick's answer.
Some of the bugs have been fixed in Beta 2, and my guess is that eventually the debugger will attach automagically when launching the extension.
Update: In the iOS 8 Beta 4 release notes:
Extensions
Fixed in beta 4
Extensions sometimes fail to launch when debugging from Xcode.
When Extension with UI is killed, it relaunches and is not dismissed.
Sometimes your Sharing or Action extension can hang.
Redeploying an extension may disable it in Notification Center.
I'm having this problem too. Xcode never attaches my debugger to the extension or displays NSLog messages. If you attach your Xcode debugger manually to your extension process, at least breakpoints work like a charm:
Debug->Attach to process->Your extension name (mine was "com.example.MyExtensionApp.MyExtension")
Create scheme for your extension
Run scheme
In a dialog choose container app
Enjoy
It works for me :)
Xcode 8 is able to debug extensions:
Choose the extension scheme in the combo next to the stop button and run it.
Select the parent application in the dialog that appears.
Result: breakpoints and log work as usual.
What finally allowed me to see the log in the debugging area, based on Michael's suggestion and Apple's documentation, is:
Build & Run the app extension in the simulator and, when prompted for a host app, choose the specific app that you're going to call the extension from. In my case I was launching my Action extension from Safari by pulling up a share sheet on a PDF.
What wasn't working before was following other people's suggestions of using Today as the host but then leaving that app and going over to Safari to call my extension. I no longer even need to run my containing app first before running the extension.
From Apple's Documentation:
In your extension scheme’s Run phase, you specify a host app as the executable. Upon accessing the extension through that specified host’s UI, the Xcode debugger attaches to the extension.
I actually got the logs to run quite simply in Xcode 6.3. Firstly, build and run the containing app. Once the containing app is running on the device, build and run the app extension by changing the scheme to the app extension.
Apple has documentation directly related to debugging, profiling and testing your app extension.
A trick which works for me (although it is quite an ugly one) is to place a dummy UILabel somewhere in the bottom corner of my extension. I usually call it logLabel. It is then possible to update the text of this label with any log statement that you want to get logged. Such approach is not very good if you need to log statements from instances of different classes. And, obviously, it clutters your UI.
However, if you have a fairly simple widget and you don't mind about slight cluttering of the UI this does the trick. I have tried all other solutions outlined in this discussion and, sadly, none of them worked for me.
The only way debugging works for me is by selecting Debug->Attach To Process By PID or Name
Then enter the PID not the extension name.
You can find the PID by running the extension on a device, go to Window->Devices. Find your device and viewing the console. When you see the name of your extension, its followed by 5 digit number. That is the PID
I also put a bunch of NSLog's in the extension in order to find the PID as well.
This is on xCode 7
Encounter the same problem about extension for NSLog, and break points. I have fought it with many days.
Device log can be found as following image. It is at XCode -> Window -> Devices and Simulators.
After enter the Open Console, there is a search field at the top-right of dialog. I can apply filter rule in there. For example, a process name contains Notification key word, or process name must equal to the name of extension target, ex: equal to MyNotificationServiceExtension process name.
Clearly something is broken in Xcode6-B5.
If I try to run a Photo extension on the Simulator I cannot see any Photos.app as an option for the extension attaching process.
The same, running on a real device, give me the correct behaviour.
In the first case any breakpoint is not honorated. In the latter case, breakpoints work like a charm.
You should know that the container app and extension are totally two difference process in iOS while the LLVM debugs only a thread a time, so when you are debugging, the console never log the extension and never stop at breakpoint.
You can solve most of the problems by #Vince Yuan's method.
However, my problem is that Xcode debugger hardly hook on my keyboard extension on both iOS Simulator and devices, like 1 time in 7-8 runs, It's totally a matter of probability. #Vince Yuan's method also work for just sometimes.
My little experience is that when you run you debug scheme, if the debug Session in the left panel showing that 'No Debug Session', there is no need to open your extension and test it, the debugger didn't hook on, just run again for lucky.
but when you see com.xxx.xxx.xxx is waiting to Attach, the extension can definitely get debugged.
This is a little trick for whom cannot debug iOS extension, especially keyboard extension.
As of Xcode 6 Beta 5, I've been able to use an actual device running iOS8 to debug my extension. Try running it on a device and select Safari to launch into
To overcome all the states caused by ever changing IDE, I'm using iOS Console by lemonjar.com – it displays a console window for any connected iOS device rendering syslog messages regardless the process ID. You can see both app and extension debug log messages at once here.
I could debug my extension with the way I describe below:
Xcode : Debug -> Attach to process by PID or Name. Your extension scheme name.
Then select your main app target and run.
I hope it also works for you guys.

Is it possible to run an app on two devices with one click on the build and run button in Xcode 5?

Is it possible to run an app on two devices with one click on the build and run button?
E.g. I have an application that has to run on two devices to test some networking functions between the devices.
It is really annoying to select each device separately from the scheme selector and then click the "build and run"-button.
So I'd like to configure my build process to let the app automatically build and run on both devices. Is this possible? And if it is, how?
Versions: Xcode5, OSX Mavericks
I found this Question but it doesn't seem to work anymore since I get the the following error message when I open the .app file:
You can’t open the application “Run” because the Classic environment is no longer supported.
Furthermore I can't select the .app file for the launch application service in the automator.
I don't know if it's possible, but perhaps to speed it up, a quick keyboard shortcut:
Switch build target HOLD: cmd + opt + ctrl THEN PRESS [ or ] -- switches target
Then, build it with cmd + r
Not exactly what you're looking for, but should cut your time fairly significantly!
Choose your Device at the top, build and run (Cmnd+R) and while running it, select a different device without stopping the other device, then build and run it again (Cmnd+R) on that device.
It definitely works with a real device and a simulator, but I don't know about 2 real devices.
Goodluck! :)

ios how to launch app on device using command line

I am doing ci stuff now. Everything works well, I can package and install ipa on device.
But I don't know how to launch the app. I search Google million times to see whether there is
some methods to do it. Unfortunately, I can't solve the problem now.
Any points. Thanks in advance.
There are a number of tools available for this now. Your mileage may vary.
https://github.com/phonegap/ios-deploy
https://github.com/libimobiledevice/libimobiledevice
https://github.com/robovm/robovm
You can also try using the Instruments command line tool for launching apps (for example, if you need to run UI Automation).
As Aaron points out RoboVM can do this using its wrappers around libimobiledevice. These can be used standalone. Just download the latest jar file from http://repo1.maven.org/maven2/org/robovm/robovm-libimobiledevice/0.0.7/ and call it like this:
java -cp robovm-libimobiledevice-0.0.7.jar org.robovm.libimobiledevice.util.AppLauncher
This will print out some help on how to use this tool.
Plug in your iOS device, put it in provisioning portal, click run on Xcode. Make sure your device is displayed on the right of the run button.
Xcode 5 should enable you to do this all from the app.

how to Run two BlackBerry simulators in windows eclipse?

How to Run two instance of BlackBerry simulator in windows eclipse?
The documentation regarding developing with BlackBerry Messenger indicates that you can run two simulators at once, at least with the simulators that come bundled with the BBM SDK.
You cannot. If you try, you will get an error message saying only one simulator can run at a time.
What you need to do is:
Install the blackberry eclipse plugins twice and make two
workspace of each eclipse.
Run the two simulators in each eclipse and error like "could not
open port 19780 and it is use by another program....." will pop
out in one of your simulator.
So made the changes in pin,
data-port values in .bat files, rimpublic.property files inside
MDS and fledge-settings.conf in one of your simulator... but this
changes will not be reflected on your eclipse.
So what you need to do is, when you click the debug configuration from your
eclipse, you will see the simulator option there. So, click the simulator and change the PIN value, whatever you have made the changes in .bat files.. and just after that in the simulator you will again find the option of network, there unselect the disable registration button...once all this changes is made click apply and restart your eclipse... this will surely solved your problem

Resources