Agent Skillsphun333/pi-infobar › macos-build

macos-build

GitHub

通过命令行使用xcodebuild构建、编译或检查macOS原生Xcode项目。支持定位工程、执行构建、解析结果及修复常见错误,适用于验证代码变更或解决编译失败场景。

.agents/skills/macos-build/SKILL.md phun333/pi-infobar

Trigger Scenarios

用户要求构建、编译或检查项目是否成功编译 用户请求修复构建错误、验证更改或运行调试构建

Install

npx skills add phun333/pi-infobar --skill macos-build -g -y
More Options

Non-standard path

npx skills add https://github.com/phun333/pi-infobar/tree/main/.agents/skills/macos-build -g -y

Use without installing

npx skills use phun333/pi-infobar@macos-build

指定 Agent (Claude Code)

npx skills add phun333/pi-infobar --skill macos-build -a claude-code -g -y

安装 repo 全部 skill

npx skills add phun333/pi-infobar --all -g -y

预览 repo 内 skill

npx skills add phun333/pi-infobar --list

SKILL.md

Frontmatter
{
    "name": "macos-build",
    "description": "Build a native macOS app using xcodebuild from the command line. Use this skill whenever the user asks to build, compile, or check if their macOS project compiles successfully. Also use it when the user asks to fix build errors, verify changes compile, or run a debug build. Trigger on phrases like \"build the app\", \"does it compile\", \"run xcodebuild\", \"fix build errors\", or even just \"build\"."
}

Build macOS App

Build any native macOS Xcode project from the command line using xcodebuild.

Finding the Project

Before building, locate the Xcode project or workspace:

find . -maxdepth 2 -name "*.xcodeproj" -o -name "*.xcworkspace" | head -5

Then list available schemes:

xcodebuild -list -project "YourApp.xcodeproj" 2>/dev/null | grep -A 20 "Schemes:"

Build Command

Use this command template, replacing the project path and scheme:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild build \
  -project "YourApp.xcodeproj" \
  -scheme "YourApp" \
  -configuration Debug \
  -destination "platform=macOS" \
  2>&1 | grep -E "(BUILD SUCCEEDED|BUILD FAILED|error:)" | head -20

For workspaces (projects with SPM dependencies or CocoaPods):

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild build \
  -workspace "YourApp.xcworkspace" \
  -scheme "YourApp" \
  -configuration Debug \
  -destination "platform=macOS" \
  2>&1 | grep -E "(BUILD SUCCEEDED|BUILD FAILED|error:)" | head -20

Interpreting Results

  • BUILD SUCCEEDED -- the build passed, report success to the user.
  • BUILD FAILED with error: lines -- read each error, identify the source file and line, and help the user fix them. After fixing, re-run the build to verify.
  • If the output is empty or unclear, re-run without the grep filter to get full output for diagnosis.

When to Build

  • After making code changes, if the user asks to verify they compile
  • When the user explicitly says "build", "compile", or "check if it builds"
  • After fixing build errors, to confirm the fix worked

Xcode Beta Toolchains

If the project targets a beta SDK (e.g., macOS 26 Tahoe), you may need to point to the beta Xcode:

DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer xcodebuild build ...

Check which Xcode is available:

ls /Applications/ | grep -i xcode

Common Build Failures

Error Fix
no such module 'Sparkle' SPM dependency not resolved. Try xcodebuild -resolvePackageDependencies first
no signing identity found Set CODE_SIGN_IDENTITY="" and CODE_SIGNING_ALLOWED=NO for command-line builds
SDK "macosx" cannot be located Wrong DEVELOPER_DIR. Check Xcode installation path
scheme not found Run xcodebuild -list to see available schemes

Version History

  • c742d89 Current 2026-07-05 18:23

Same Skill Collection

.agents/skills/macos-auto-update/SKILL.md
.agents/skills/macos-notch-ui/SKILL.md
.agents/skills/macos-patterns/SKILL.md
.agents/skills/macos-release/SKILL.md
.agents/skills/macos-settings-ui/SKILL.md

Metadata

Files
0
Version
c742d89
Hash
21df9b33
Indexed
2026-07-05 18:23

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 19:09
浙ICP备14020137号-1 $Гость$