Running XCTest on iphone device - xctest

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.

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?

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?

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

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.

iphone automation testing using uiautomation automation instrument

i'm using instrument 4.1 and i'm able to run my script but i'm not able to run the same script in instruments 4.2 it is throwing an exception target appears to have died .
Using command line i'm able to load the app but the script is not running.
thanks
Script will run only if it has any device / simulator belonging to your upgraded simulator version. If you have upgraded your ios simualator version from 4.X to 5.X, then it will not support and device / simulator belonging to 4.X. Try connecting a device / simulator as per your latest ios simulator version and your script will execute successfully.

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...