build_project
Build an Xcode project or workspace, returning errors and warnings with optional timeout and regex filtering.
Instructions
Build the specified Xcode project or workspace.
Builds run for up to `timeout` seconds (default 600, i.e. 10 minutes) before
timing out, which guards against a build that hangs indefinitely. Raise it
for large projects whose cold build exceeds the default.
Args:
project_path: Path to an Xcode project or workspace directory.
scheme: Name of the scheme to build. If not provided, uses the active scheme.
include_warnings: Include warnings in build output. If not provided, uses global setting.
regex_filter: Optional regex to filter error/warning lines
max_lines: Maximum number of error/warning lines to show (default 25)
timeout: Maximum seconds to wait for the build to complete. If not
provided, defaults to 600. Must be a positive integer.
Returns:
Always returns JSON with format:
{
"full_log_path": "~/Library/Caches/xcode-mcp-server/logs/build-{hash}.txt",
"summary": {"total_errors": N, "total_warnings": M, "showing_errors": X, "showing_warnings": Y},
"errors_and_warnings": "Build failed with N errors...
error: ... ..." } The errors_and_warnings field contains a summary message followed by the actual errors/warnings. Errors are prioritized over warnings - errors are shown first, then warnings fill remaining slots.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| scheme | No | ||
| include_warnings | No | ||
| regex_filter | No | ||
| max_lines | No | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |