Can Xcode's OCUnit tests run on iOS device rather than simulator - objective-c

I am trying to run OCUnit tests using my iPad but find that Xcode (version 4.3.3) always
gives the message Test Succeeded even if the test actually failed - i.e. the debug console logs the test as failed. If I run exactly the same tests but using the simulator the tests fail as I would expect.
For example I created a new project with the following test:
- (void)testExample
{
STFail(#"This test should fail");
}
When I ran it on iPad Xcode gave the Test Succeeded message:
When I ran it on the simulator Xcode gave me the Test Failed message:
Is it possible to get a Test Failed message running this on an iOS device?
Thank you!

The SenTesting framework is not complete and it does not guarantee to work with devices, But it does work fine with the simulator. In order to run unit test on your device, I recommend you to use this library,
GHUnit

Im not sure exactly what your asking, but the simulator works exactly the same. So be sure to keep the device plugged in to the computer when you are doing these tests. Yes you really do need to rephrase your question, i will be back when you do so.

Related

Simulator not running XCTest tests

I am new to running unit tests in Xcode (with XCText). I created an empty iOS application and just tried running the tests (which should fail by default). The iOS simulator starts and the toolbar console just shows "testing..." and it just hangs forever. I don't see any error in the console. If I try running the tests on a device (iPhone 5 in my case), the tests run just fine.
I am using Xcode 5.1.1 and simulator 7.1
Any idea on what could be causing this?

Running XCTest on iphone device

I am trying to run XCTest on iphone device but Xcode show be following message.
"Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator." 
Is there any way by which I can run the XCTest on device?
Thanks,
Dev
Ok. I found that using GHUnit we can run unit tests on iphone device. Internally it uses xctest. Here is how you setup GHUnit.
I was able to follow the instructions and setup unit tests using xcode 5.

iOS code coverage for UIAutomation functional tests

I want to generate the code coverage files for our iOS App.
The problem is that when I build the code with the test coverage settings it builds and then the Simulator launches the App. Now I want to run my UIAutomation functional tests, but as soon as I kick off my tests using the instruments command, the Simulator restarts!
For code coverage files to be generated, the App must not restart.
Has anybody found a way yet to use the already running simulator to execute the UIAutomation tests?
You may be able to find some ideas from this previous question
Is there any way to test the code coverage of UIAutomation tests?

iPod App crashes on launch

Is it normal that when i try to test my app it crashes on launch?
I explain.
I have my app that works fine in the simulator. I wanted to try to test it on my iPod Touch 4g.
I built and run from XCode, and that's what happened: the app launches fine (it shows me a black splash screen),but then suddenly it comes back to the springboard,with no reason.
If i open up the app manually,after it crashed,it works without any problems. It happens only one time,just when i build and run,and i don't know why.
How can i do to avoid this? On simulator it works with any crashes,but when i run it over my iPod,it crashes.
Program ended with exit code: 0 // on simulator
The app is likely to be failing to run on the device as xcode is trying to attach the debugger to it but doesn't have permission to do so.
Check your entitlements.plist within your project; you probably have one that has get-task-allow set to NO. This needs to be 'YES' to allow the debugger to attach. (It does need to be 'NO' for adhoc builds though - one solution is to exclude the entitlements.plist file from the debug build.)

Testing BlackBerry code without starting the device simulator

In Eclipse, I want to test some java microedition network code -- javax.microedition.io.HttpConnection -- to see if the network connection is successful and get some cookie values. But running this code using a JRE on my development machine doesn't execute the method, unless I launch and test using a simulator.
Can I run BlackBerry code using a desktop JRE or will I always have to test using a simulator?
I've never heard of a way of running BB code without running the simulator. You can set a program to automatically start the simulator and "click" some buttons so you can run tests automatically, but I don't think this is what you're looking for...