There are two files:
- xcodebuild- the script that the agent is expected to run
- building-with-xcode.md- the instructions given to the agent, i.e. in CLAUDE.md
When invoked:
./XXX.xcworkspace..claude/scripts/xcodebuild <your_params>Follow these rules:
.claude/scripts/xcodebuild are the same as to system's xcodebuild.clean option. NEVER..claude/scripts/xcodebuild writes build results to an output file.Read and Search tools to interpret the output file.| #!/bin/bash | |
| set -eo pipefail | |
| mkdir -p ./build/xcodebuild | |
| timestamp=$(date +%Y-%m-%d-%H-%M-%S) | |
| temp_file=$(mktemp ./build/xcodebuild/xcodebuild-output-${timestamp}.XXXXXX) | |
| set +e | |
| xcodebuild "$@" &> "$temp_file" | |
| exit_code=$? | |
| set -e | |
| file_size=$(wc -c < "$temp_file" | tr -d ' ') | |
| echo "Build output saved to: $temp_file" | |
| echo "Build output size: $file_size bytes" | |
| if [ $exit_code -eq 0 ]; then | |
| echo "Build status: SUCCESS" | |
| else | |
| echo "Build status: FAILED (exit code: $exit_code)" | |
| fi | |
| exit $exit_code |