I just discovered xcresulttool - provided with the Xcode Command Line Tools. It does an amazing job generating a JSON report of warnings/failures. The tool requires a xcresult
file path - my issue is that xcodebuild build
does not produce an xcresult
file so I can't find a way to generate a similar report for that action.
My use case is simple - in my CI job, I want to report back on specific failures during builds and tests. I run xcodebuild build-for-testing
and then later xcodebuild test-without-building
. If there is a failure during the test phase, I can easily parse the issues from the JSON report in xcresult. However, if there is a failure during build, there is no result file to parse from.
What is more confusing is that if you run xcodebuild test
(build and test in one command) compilation errors are put in the xcresult file and you can read them just fine with xcresulttool.
Is there any way to get a failure report from xcodebuild build
actions without parsing stdout/stderror? I am aware of 3rd party tools such as xcpretty or xcbeautify - I would like to avoid anything that requires parsing the output.