Xcode5 includes better support for cmd-line tests. For example, I can run iOS tests with the following:

Simulator Tests

xcodebuild -workspace ${module.name}.xcworkspace test -scheme ${module.name} -destination OS=7.0,name=iPhone -destination-timeout=10 -configuration Debug

Device Tests

And it is now possible to execute tests on the actual device hardware by specifying the device's name:

xcodebuild -workspace ${module.name}.xcworkspace test -scheme ${module.name} -destination id=${device.name} -destination-timeout=10 -configuration Debug

OSX Tests

What is the correct cmd-line for executing OSX tests?

有帮助吗?

解决方案

According to the man page you need to specify the platform as 'OS X' and optionally the arch which can be x86_64 (default) or i386, eg.

xcodebuild test -scheme {schemename} -destination platform='OS X',arch=x86_64

If you're just building with the default destination though i've also found that you can omit the destination flag entirely

其他提示

I use xcrun -sdk and pass the -sdk parameter as well. But apparently, the -destination is now mandatory to overwrite the project settings regarding to the last device target set on the xcode project.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top