How to Run xcbeautify on xcodebuild Output in GitHub Actions
Pipe xcodebuild through xcbeautify for readable CI logs, and set pipefail so the build status is not lost to the pipe.
xcbeautify formats raw xcodebuild output into clean, annotated logs. Pipe with set -o pipefail so a build failure still fails the step instead of being masked by xcbeautify exiting 0.
Steps
- Install xcbeautify with
brew install xcbeautify. - Run xcodebuild with
set -o pipefailand pipe intoxcbeautify. - Add
--renderer github-actionsfor inline annotations.
Workflow
.github/workflows/ci.yml
jobs:
test:
runs-on: macos-latest
env:
HOMEBREW_NO_AUTO_UPDATE: '1'
steps:
- uses: actions/checkout@v4
- run: brew install xcbeautify
- name: Test
run: |
set -o pipefail
xcodebuild test \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \
| xcbeautify --renderer github-actionsGotchas
- Without
set -o pipefail, the step exit code is xcbeautify's (0), so failed builds look green. - xcbeautify reads xcodebuild text output; it does not parse the result bundle, so combine it with
-resultBundlePathif you need the raw data too.
Related guides
How to Run iOS Tests on a Simulator in GitHub ActionsRun XCTest/XCUITest on a GitHub Actions macOS runner with xcodebuild test and a -destination that targets an…
How to Build a macOS App With xcodebuild in GitHub ActionsBuild a macOS app on a GitHub Actions runner with xcodebuild build, targeting the platform=macOS destination…