Igor Kulman

More readable XCode build output for CI

· Igor Kulman

If you use Continuous Integration (CI) builds or build your app from the command line using xcodebuild you know that the output is not pretty and not very readable. Reading the build output is important when a CI build breaks, but it is not easy when it looks like this

xcodebuild output

Many iOS developers were not satisfied with this so the xcpretty project was created. Xcpretty is a fast and flexible formatter that turn the output from screnshot above to this neatly formatted output

xcodebuild output with xcpretty

The unit tests output looks especially nice

xcodebuild tests output with xcpretty

Using xcpretty is easy, you install it as a gem (gem install xcpretty) and then pipe the results of your xcodebuild commands to it like this xcodebuild test -project iOSSampleApp.xcodeproj -scheme iOSSampleApp -destination 'platform=iOS Simulator,name=iPhone 6s,OS=11.0' | xcpretty

You can use it with any CI that allows installing custom utilities. I use Travis CI, you can take a look at my .travis.yml config.

See also