/building-apple-platform-products
Builds, tests, archives, and deploys Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, swift test, xcrun simctl, xcrun devicectl, or any xcrun developer tool. Covers project discovery, simulator management, physical device
$ npx -y skills add kylehughes/apple-platform-build-tools-claude-code-plugin --skill building-apple-platform-products --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/building-apple-platform-products
Context preview
The summary Claude sees to decide when to auto-load this skill.
Builds, tests, archives, and deploys Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, swift test, xcrun simctl, xcrun devicectl, or any xcrun developer tool. Covers project discovery, simulator management, physical device
SKILL.md
building-apple-platform-products.SKILL.mdname: building-apple-platform-products
description: Builds, tests, archives, and deploys Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, swift test, xcrun simctl, xcrun devicectl, or any xcrun developer tool. Covers project discovery, simulator management, physical device deployment, code signing, profiling, distribution, and binary inspection.
Building Apple Platform Products
Build, test, archive, deploy, and automate Swift packages and Xcode projects for Apple platforms.
When to Use This Skill
Use this skill when you need to:
- Build an iOS, macOS, tvOS, watchOS, or visionOS app
- Build a Swift package
- Run unit tests or UI tests
- Create an archive for distribution
- Discover project structure (schemes, targets, configurations)
- Manage simulators (create, boot, configure, install apps)
- Deploy to physical devices
- Automate simulator testing (permissions, push notifications, screenshots, location)
- Sign, notarize, or distribute apps
- Inspect binaries or debug symbols
- Profile app performance
- Resolve xcrun tool paths or switch Xcode versions
xcrun Tool Resolution
`xcrun` resolves and executes Xcode developer tools without hardcoded paths. All tools in this skill are accessed through xcrun (e.g., `xcrun simctl`, `xcrun devicectl`, `xcrun xctrace`).
| Goal | Command | |------|---------| | Find tool path | `xcrun --find <tool>` | | Show SDK path | `xcrun --sdk iphoneos --show-sdk-path` | | Switch Xcode (per-command) | `DEVELOPER_DIR=/path/to/Xcode.app/Contents/Developer xcrun <tool>` | | Switch Xcode (system) | `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` | | Clear cache after upgrade | `xcrun --kill-cache` |
For tool resolution priority, toolchain selection, or debugging, see [xcrun-basics.md](references/xcrun-basics.md).
Tool Selection
| Project Type | Primary Tool | When to Use | |--------------|--------------|-------------| | Standalone `Package.swift` | `swift build` | Libraries, CLI tools, cross-platform Swift (no .xcodeproj) | | `.xcworkspace` | `xcodebuild -workspace` | CocoaPods or multi-project setups | | `.xcodeproj` | `xcodebuild` | Standard Xcode projects (including those with SPM dependencies) |
**Important**: The `swift build` / `swift test` commands only work for **standalone Swift packages**. If a Swift package is embedded as a submodule within an Xcode project, you must use `xcodebuild` with the appropriate scheme—the Swift CLI cannot orchestrate builds in that context.
Project Discovery
Before building, discover the project structure:
# Find what project files exist
ls Package.swift *.xcworkspace *.xcodeproj 2>/dev/null
# List schemes and targets (auto-detects project)
xcodebuild -list
# Describe package (standalone SPM only)
swift package describe
**Note**: When an Xcode project references a local Swift package, each package **target** gets its own scheme (named after the target, not the package). Use these schemes to build individual targets without building the entire app.
For mixed projects, shared schemes, or detailed output parsing, see [project-discovery.md](references/project-discovery.md).
Swift Package Manager Commands
**Important**: These commands only work for standalone Swift packages, not Swift Package Manager submodules in Xcode projects.
| Goal | Command | |------|---------| | Build (debug) | `swift build` | | Build (release) | `swift build -c release` | | Run executable | `swift run [<target>]` | | Run tests | `swift test` | | Run specific test | `swift test --filter <TestClass.testMethod>` | | Show binary path | `swift build --show-bin-path` | | Clean | `swift package clean` | | Initialize | `swift package init [--type library\|executable]` |
For cross-compilation, Package.swift syntax, or dependency management, see [swift-package-manager.md](references/swift-package-manager.md).
xcodebuild Commands
**Command structure**: `xcodebuild [action] -scheme <name> [-workspace|-project] [options] [BUILD_SETTING=value]`
| Goal | Command | |------|---------| | List schemes | `xcodebuild -list` | | Build | `xcodebuild build -scheme <name>` | | Test | `xcodebuild test -scheme <name> -destination '<spec>'` | | Build for testing | `xcodebuild build-for-testing -scheme <name> -destination '<spec>'` | | Test without build | `xcodebuild test-without-building -scheme <name> -destination '<spec>'` | | Archive | `xcodebuild archive -scheme <name> -archivePath <path>.xcarchive` | | Clean | `xcodebuild clean -scheme <name>` |
**Required**: `-scheme` is always required. Add `-workspace` or `-project` when multiple exist. **For tests**: `-destination` is required for iOS/tvOS/watchOS/visionOS targets.
For build settings, SDK selection, or CI configuration, see [xcodebuild-basics.md](references/xcodebuild-basics.md).
Common Destinations
| Platform | Destination Specifier | |----------|----------------------| | macOS | `'platform=macOS'` | | iOS Simulator | `'platform=iOS Simulator,name=iPhone 17'` | | iOS Device | `'platform=iOS,id=<UDID>'` | | tvOS Simulator | `'platform=tvOS Simulator,name=Apple TV'` | | watchOS Simulator | `'platform=watchOS Simulator,name=Apple Watch Series 11 (46mm)'` | | visionOS Simulator | `'platform=visionOS Simulator,name=Apple Vision Pro'` | | Generic (build only) | `'generic/platform=iOS'` |
**Note**: Simulator names change with each Xcode release. Always verify available simulators:
xcrun simctl list devices available
For all platforms, multiple destinations, or troubleshooting destination errors, see [destinations.md](references/destinations.md).
Simulator Management (simctl)
`xcrun simctl` manages the full simulator lifecycle and enables test automation without launching Xcode.
| Goal | Command | |------|---------| | List available simulators | `xcrun simctl list devices available` | | Create simulator | `xcrun simctl create "<name>" "<type>" "<runtime>"` | | Boot / shutdown | `
Read more
name: building-apple-platform-products description: Builds, tests, archives, and deploys Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, swift test, xcrun simctl, xcrun devicectl, or any xcrun developer tool. Covers project discovery, simulator management, physical device deployment, code signing, profiling, distribution, and binary inspection.
Building Apple Platform Products
Build, test, archive, deploy, and automate Swift packages and Xcode projects for Apple platforms.
When to Use This Skill
Use this skill when you need to:
- Build an iOS, macOS, tvOS, watchOS, or visionOS app
- Build a Swift package
- Run unit tests or UI tests
- Create an archive for distribution
- Discover project structure (schemes, targets, configurations)
- Manage simulators (create, boot, configure, install apps)
- Deploy to physical devices
- Automate simulator testing (permissions, push notifications, screenshots, location)
- Sign, notarize, or distribute apps
- Inspect binaries or debug symbols
- Profile app performance
- Resolve xcrun tool paths or switch Xcode versions
xcrun Tool Resolution
`xcrun` resolves and executes Xcode developer tools without hardcoded paths. All tools in this skill are accessed through xcrun (e.g., `xcrun simctl`, `xcrun devicectl`, `xcrun xctrace`).
| Goal | Command | |------|---------| | Find tool path | `xcrun --find <tool>` | | Show SDK path | `xcrun --sdk iphoneos --show-sdk-path` | | Switch Xcode (per-command) | `DEVELOPER_DIR=/path/to/Xcode.app/Contents/Developer xcrun <tool>` | | Switch Xcode (system) | `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` | | Clear cache after upgrade | `xcrun --kill-cache` |
For tool resolution priority, toolchain selection, or debugging, see [xcrun-basics.md](references/xcrun-basics.md).
Tool Selection
| Project Type | Primary Tool | When to Use | |--------------|--------------|-------------| | Standalone `Package.swift` | `swift build` | Libraries, CLI tools, cross-platform Swift (no .xcodeproj) | | `.xcworkspace` | `xcodebuild -workspace` | CocoaPods or multi-project setups | | `.xcodeproj` | `xcodebuild` | Standard Xcode projects (including those with SPM dependencies) |
**Important**: The `swift build` / `swift test` commands only work for **standalone Swift packages**. If a Swift package is embedded as a submodule within an Xcode project, you must use `xcodebuild` with the appropriate scheme—the Swift CLI cannot orchestrate builds in that context.
Project Discovery
Before building, discover the project structure:
# Find what project files exist ls Package.swift *.xcworkspace *.xcodeproj 2>/dev/null # List schemes and targets (auto-detects project) xcodebuild -list # Describe package (standalone SPM only) swift package describe
**Note**: When an Xcode project references a local Swift package, each package **target** gets its own scheme (named after the target, not the package). Use these schemes to build individual targets without building the entire app.
For mixed projects, shared schemes, or detailed output parsing, see [project-discovery.md](references/project-discovery.md).
Swift Package Manager Commands
**Important**: These commands only work for standalone Swift packages, not Swift Package Manager submodules in Xcode projects.
| Goal | Command | |------|---------| | Build (debug) | `swift build` | | Build (release) | `swift build -c release` | | Run executable | `swift run [<target>]` | | Run tests | `swift test` | | Run specific test | `swift test --filter <TestClass.testMethod>` | | Show binary path | `swift build --show-bin-path` | | Clean | `swift package clean` | | Initialize | `swift package init [--type library\|executable]` |
For cross-compilation, Package.swift syntax, or dependency management, see [swift-package-manager.md](references/swift-package-manager.md).
xcodebuild Commands
**Command structure**: `xcodebuild [action] -scheme <name> [-workspace|-project] [options] [BUILD_SETTING=value]`
| Goal | Command | |------|---------| | List schemes | `xcodebuild -list` | | Build | `xcodebuild build -scheme <name>` | | Test | `xcodebuild test -scheme <name> -destination '<spec>'` | | Build for testing | `xcodebuild build-for-testing -scheme <name> -destination '<spec>'` | | Test without build | `xcodebuild test-without-building -scheme <name> -destination '<spec>'` | | Archive | `xcodebuild archive -scheme <name> -archivePath <path>.xcarchive` | | Clean | `xcodebuild clean -scheme <name>` |
**Required**: `-scheme` is always required. Add `-workspace` or `-project` when multiple exist. **For tests**: `-destination` is required for iOS/tvOS/watchOS/visionOS targets.
For build settings, SDK selection, or CI configuration, see [xcodebuild-basics.md](references/xcodebuild-basics.md).
Common Destinations
| Platform | Destination Specifier | |----------|----------------------| | macOS | `'platform=macOS'` | | iOS Simulator | `'platform=iOS Simulator,name=iPhone 17'` | | iOS Device | `'platform=iOS,id=<UDID>'` | | tvOS Simulator | `'platform=tvOS Simulator,name=Apple TV'` | | watchOS Simulator | `'platform=watchOS Simulator,name=Apple Watch Series 11 (46mm)'` | | visionOS Simulator | `'platform=visionOS Simulator,name=Apple Vision Pro'` | | Generic (build only) | `'generic/platform=iOS'` |
**Note**: Simulator names change with each Xcode release. Always verify available simulators:
xcrun simctl list devices available
For all platforms, multiple destinations, or troubleshooting destination errors, see [destinations.md](references/destinations.md).
Simulator Management (simctl)
`xcrun simctl` manages the full simulator lifecycle and enables test automation without launching Xcode.
| Goal | Command | |------|---------| | List available simulators | `xcrun simctl list devices available` | | Create simulator | `xcrun simctl create "<name>" "<type>" "<runtime>"` | | Boot / shutdown | `
Build, test, and archive Swift packages and Xcode projects for Apple platforms with Claude Code.
Repo: kylehughes/apple-platform-build-tools-claude-code-plugin

