Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter the xcodebuild command line output?

Running xcodebuild from the console will bring you very verbose output and I wasn't able to locate any options for limit its output in order to display only warnings and errors.

I'm looking for a way to capture the xcodebuild output and filter it. It would prefer a Python solution that will work with pipes but I'm open to other approaches as long they are command line based solutions.

Are any tools that are already able to do this?

like image 276
sorin Avatar asked Feb 11 '10 13:02

sorin


2 Answers

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.

like image 165
Amin Ariana Avatar answered Sep 25 '22 01:09

Amin Ariana


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.

like image 42
Koraktor Avatar answered Sep 25 '22 01:09

Koraktor