xcpretty

Flexible and fast xcodebuild formatter

Github星跟踪图

logo

xcpretty is a fast and flexible formatter for xcodebuild.
It does one thing, and it should do it well.

Gem version
Build Status
Code Climate
Reviewed by Hound

Installation

$ gem install xcpretty

Usage

$ xcodebuild [flags], xcpretty

xcpretty is designed to be piped with xcodebuild and thus keeping 100%
compatibility with it. It's even a bit faster than xcodebuild itself, since
it saves your terminal some prints.

Important: If you're running xcpretty on a CI like Travis or Jenkins, you
may want to exit with same status code as xcodebuild.
CI systems usually use status codes to determine if the build has failed.

$ set -o pipefail && xcodebuild [flags], xcpretty
#
# OR
#
$ xcodebuild [flags], xcpretty && exit ${PIPESTATUS[0]}

Raw xcodebuild output

You might want to use xcpretty together with tee to store the raw log in a
file, and get the pretty output in the terminal. This might be useful if you
want to inspect a failure in detail and aren't able to tell from the pretty
output.

Here's a way of doing it:

$ xcodebuild [flags], tee xcodebuild.log, xcpretty

Formats

ANSI / UTF-8

  • --[no-]color: Show build icons in color. (you can add it to --simple or --test format).
    Defaults to auto-detecting color availability.
  • --[no-]utf: Use unicode characters in build output or only ASCII.
    Defaults to auto-detecting the current locale.

Reporters

  • --report junit, -r junit: Creates a JUnit-style XML report at build/reports/junit.xml, compatible with Jenkins and TeamCity CI.

  • --report html, -r html: Creates a simple HTML report at build/reports/tests.html.
    xcpretty html

  • --report json-compilation-database, -r json-compilation-database: Creates a JSON compilation database at build/reports/compilation_db.json. This is a format to replay single compilations independently of the build system.

Writing a report to a custom path can be specified using --output PATH.

Extensions

xcpretty supports custom formatters through the use of the
--formatter flag, which takes a path to a file as an argument. The
file must contain a Ruby subclass of XCPretty::Formatter, and
return that class at the end of the file. The class
can override the format_* methods to hook into output parsing
events.

Known extensions

The recommended format is a gem containing the formatter and named
with an xcpretty- prefix, for easier discovery.

Team

主要指标

概览
名称与所有者xcpretty/xcpretty
主编程语言Ruby
编程语言Ruby (语言数: 3)
平台
许可证Other
所有者活动
创建于2013-12-09 01:31:14
推送于2025-03-26 19:42:24
最后一次提交2025-03-26 21:42:02
发布数33
最新版本名称v0.4.1 (发布于 2025-03-26 21:42:20)
第一版名称v0.0.2 (发布于 2013-12-08 23:37:57)
用户参与
星数4k
关注者数61
派生数291
提交数628
已启用问题?
问题数232
打开的问题数90
拉请求数101
打开的拉请求数28
关闭的拉请求数39
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?