How to Use xcsift for AI-Parsable Xcode Build Output
Install and use xcsift to transform verbose Xcode build logs into structured JSON that AI models parse efficiently for faster error resolution.
Copying and pasting verbose Xcode build console logs into tools like Codex, Claude, or VS Code Copilot often confuses AI models due to the unstructured format.Łukasz Domaradzki built xcsift to parse xcodebuild and SPM output into concise JSON, making it easy for LLMs to understand errors and provide precise solutions.
Installation via Homebrew
Install xcsift using Homebrew for quick setup on macOS. If you don’t have Homebrew installed, check out my How to Install Homebrew on macOS post for detailed instructions on how to install Homebrew.
1
2
3
4
5
# Add the custom tap
brew tap ldomaradzki/xcsift
# Install the tool
brew install xcsift
Verify the installation:
1
xcsift --version
This outputs the version number, confirming xcsift is ready in your PATH.
Basic Usage
Pipe xcodebuild output to xcsift to get structured JSON instead of raw logs. Always redirect stderr to stdout with 2>&1 to capture all errors and warnings.
1
2
# Build a project and parse output
xcodebuild build 2>&1 | xcsift
Expected output is JSON summarizing the build:
1
2
3
4
5
6
7
8
9
{
"status": "success",
"summary": {
"errors": 0,
"warnings": 1,
"failed_tests": 0,
"build_time": "2.5 seconds"
}
}
xcsift filters noise, extracts errors with file/line details, and counts issues, reducing tokens for AI processing.
Handling Tests and Warnings
For test runs, pipe similarly to get failure details.
1
2
# Run tests with parsed output
xcodebuild test 2>&1 | xcsift
To include detailed warnings in the JSON (default shows only count):
1
2
# Build with full warnings
xcodebuild build 2>&1 | xcsift --print-warnings
This adds a warnings array to the JSON, like:
1
2
3
4
5
6
7
8
9
{
"warnings": [
{
"file": "ViewController.swift",
"line": 23,
"message": "variable 'temp' was never used; consider removing it"
}
]
}
Use this for SPM projects too:
1
2
# Swift Package Manager build
swift build 2>&1 | xcsift
xcsift works with Swift 5.9+ and Xcode 15+, optimized for macOS arm64.
For more details, read the docs here.
☕ Support My Work
If you found this post helpful and want to support more content like this, you can buy me a coffee!
Your support helps me continue creating useful articles and tips for fellow developers. Thank you! 🙏