Question

I've been trying to find a way to run a single iOS unit test among multiple tests with the command line on an iOS device.

Here is what I've found thus far...

  • I can use xcodebuild test [options] to build & run every tests.
  • Found a tool called xctest in /Applications/Xcode.app/Contents/Developer/usr/bin. I've looked up in the man page and it is possible to run a single test. When I try using it, I get an error stating that I'm using x86_64 architecture and then a posix error pops after. This seems to indicate that it might be the xctest for Mac OS X apps.
  • Found another xctest in for the iPhone Simulator.. but I want to run it on a iOS device

I know that it is possible to select the tests I wish to run in a scheme, but this is problematic since I would need a very skillful & patient monkey to manually do this in a build system.

By the way, I am not using Apple's own Continuous Integration system with bots and using it is out of question because another build system is used for every other platform.

My question is: How can I run a single unit test (XCTest) from the command line with build automation in mind?


P.S: I don't have any code signing issues.

Was it helpful?

Solution

Try using xctool which can run tests on devices https://github.com/facebook/xctool

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top