【问题标题】:xcodebuild print errors onlyxcodebuild 仅打印错误
【发布时间】:2015-03-31 09:49:51
【问题描述】:

我在 SO How to filter the xcodebuild command line output? 看到了这个命令

当我们执行 xcodebuild 时只显示错误和警告,否则 xcodebuild 命令会将所有关于它正在做什么的内容打印到控制台。

有没有办法在 ant 任务中使用 grep 和 xcodebuild?

 <exec executable="xcodebuild" failonerror="true">
                <arg value="| grep error" />
                <arg value="clean" />
                <arg value="build" />
  </exec> 

上面的 exec 任务在尝试执行 ant 任务时抛出错误。

【问题讨论】:

    标签: ant xcodebuild


    【解决方案1】:

    This 问题可能会有所帮助。我还认为您需要先调用操作,然后再调用 grep。也许这会起作用:

    <exec dir="${projectPath}/" executable="bash" failonerror="true">
       <arg value="-c"/>
       <arg value="xcodebuild clean build | grep error"/>
    </exec>
    

    【讨论】:

    • 是的,谢谢,这似乎有效.. 但是必须为执行添加目录
    【解决方案2】:

    -quiet 不打印除警告和错误以外的任何输出

    xcodebuild clean build -quiet
    

    它有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-09
      • 1970-01-01
      • 1970-01-01
      • 2013-10-12
      • 1970-01-01
      相关资源
      最近更新 更多