Running Tests on the Command Line

One thing that may have occurred to you is that all the tests run up to this point have been performed in the Xcode GUI, either by clicking gutter buttons in the editor view, run buttons in the Test navigator, or with the menu item Product > Test (U). That’s all well and good, but it’s obviously inadequate if you want your tests to be part of a continuous integration (CI) process, one which automatically runs tests for you, either periodically (like every night), or maybe every time new code is checked in.

Fortunately, it’s simple to have Xcode run tests from the command line or in a shell script. It’s actually a lot like automated building of your project, which you saw way back in Building on the Command ...

Get Xcode Treasures now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.