How to filter the xcodebuild command line output?

There’s a Ruby gem called xcpretty.

It filters the output of xcodebuild and also provides different formatters and coloring.

UPDATE: As Mike Hardy correctly states in the comments to this answer, xcpretty is no longer maintained.


Use xcodebuild -quiet.

According to the xcodebuild man page:

-quiet : Do not print any output except for warnings and errors.

Bonus: No other tools necessary! (Although I also like xcodebuild | xcpretty)

I build with Travis CI, which complains after 4 MB of logs. This argument solved the problem.


This isn't sufficient for me. Piping to /dev/null will just show you that a build failed, but you don't see the reason(s) why. Ideally we could see just the errors and/or warnings without all of the successful compiler commands.

This basically does the job:

xcodebuild | grep -A 5 error: