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

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

问题描述

从控制台运行 xcodebuild 将为您带来非常详细的输出,我无法找到任何选项来限制其输出以仅显示警告和错误.

我正在寻找一种方法来捕获 xcodebuild 输出并对其进行过滤.它更喜欢使用管道的 Python 解决方案,但我对其他方法持开放态度,只要它们是基于命令行的解决方案.

是否有任何工具已经能够做到这一点?

解决方案

要仅查看错误输出消息,请将标准输出重定向到/dev/null(一个用作黑洞的特殊文件),如下所示:

>

xcodebuild >/dev/null

如果要将错误输出捕获到文件中,可以这样做:

xcodebuild 2> ./build_errors.log

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?

解决方案

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天全站免登陆