如何过滤xcodebuild命令行输出? [英] How to filter the xcodebuild command line output?

查看:73
本文介绍了如何过滤xcodebuild命令行输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从控制台运行 xcodebuild 会带给您非常冗长的输出,并且我无法找到任何限制其输出的选项以仅显示警告和错误。

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.

我正在寻找一种捕获 xcodebuild 输出并对其进行过滤的方法。宁愿使用可以与管道一起使用的Python解决方案,但我愿意接受其他方法,只要它们是基于命令行的解决方案即可。

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?

推荐答案

仅显示错误输出消息,请将标准输出重定向到/ dev / null(一个特殊文件就像黑洞一样)

To only see the error output messages, redirect the standard output to /dev/null (a special file that works as a black hole) like this:

xcodebuild > /dev/null

如果要将错误输出捕获到文件中,可以执行以下操作:

If you want to capture the error output into a file, you can do:

xcodebuild 2> ./build_errors.log

这篇关于如何过滤xcodebuild命令行输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆