xcbeautify Documentation

repository·main·Indexed 23 days ago

https://github.com/cpisciotta/xcbeautify

A fast, Swift-based beautifier tool for xcodebuild that provides human-friendly, colored output. Supports modern build systems, parallel testing, Swift Package Manager, and specialized renderers for GitHub Actions, TeamCity, and Azure DevOps Pipelines.

Tokens
646
Snippets
5
Records
5
Agent score
31%

What's inside xcbeautify

  1. Basic Usage of xcbeautify

    main

    Pipe the output of xcodebuild into xcbeautify to get human-friendly, colored output. For Swift Package Manager, pipe swift test output into xcbeautify.

    xcodebuild [flags] | xcbeautify
    swift test [flags] 2>&1 | xcbeautify
  2. Install xcbeautify

    main

    You can install xcbeautify using Homebrew, Mint, or by building from source.

    ### Homebrew
    
    ```bash
    brew install xcbeautify

    Mint

    mint install cpisciotta/xcbeautify

    Build from source

    git clone https://github.com/cpisciotta/xcbeautify.git
    cd xcbeautify
    make install
  3. Ensure xcbeautify exits with xcodebuild's status code

    main

    When running in CI environments, use set -o pipefail to ensure that xcbeautify exits with the same status code as the preceding xcodebuild command.

    set -o pipefail && xcodebuild [flags] | xcbeautify
  4. Optimize output for parallel and concurrent testing

    main

    For parallel and concurrent destination testing, it is recommended to use unbuffered I/O for stdout and redirect stderr to stdout using NSUnbufferedIO=YES and 2>&1.

    NSUnbufferedIO=YES xcodebuild [flags] 2>&1 | xcbeautify
  5. Use xcbeautify renderers for CI platforms

    main

    Use the --renderer flag to enable specialized output formats for different CI providers. This allows warnings, errors, and results to be highlighted directly within the CI user interface.

    • GitHub Actions: Use --renderer github-actions to leverage GitHub workflow commands.
    • TeamCity: Use --renderer teamcity to leverage TeamCity service messages.
    • Azure DevOps Pipeline: Use --renderer azure-devops-pipelines to leverage Azure DevOps logging commands.
    ### GitHub Actions
    
    ```bash
    set -o pipefail && xcodebuild [flags] | xcbeautify --renderer github-actions

    TeamCity

    xcodebuild [flags] | xcbeautify --renderer teamcity

    Azure DevOps Pipeline

    xcodebuild [flags] | xcbeautify --renderer azure-devops-pipelines