Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Building Apple Platform Products

ASecurity

Builds, tests, and archives Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, or swift test commands, discovering schemes and targets, or selecting simulator destinations for iOS, macOS, tvOS, watchOS, or visionOS.

59 stars
0 votes
0 copies
13 views
Added 12/19/2025
developmentgoswiftbashtesting

Works with

cli

Security Analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned 2/12/2026

$npx -y skills add kylehughes/apple-platform-build-tools-claude-code-plugin --skill building-apple-platform-products --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Building Apple Platform Products?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Building Apple Platform Products
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kylehughes-building-apple-platform-products/badge)](https://www.skillsdirectory.com/skills/kylehughes-building-apple-platform-products)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: building-apple-platform-products
description: Builds, tests, and archives Swift packages and Xcode projects for Apple platforms. Use when running xcodebuild, swift build, or swift test commands, discovering schemes and targets, or selecting simulator destinations for iOS, macOS, tvOS, watchOS, or visionOS.
---

# Building Apple Platform Products

Build, test, and archive 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)

## 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:

```bash
# 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:
```bash
xcrun simctl list devices available
```

For all platforms, multiple destinations, or troubleshooting destination errors, see [destinations.md](references/destinations.md).

## Reference Files

| Topic | File | When to Read |
|-------|------|--------------|
| Project Discovery | [project-discovery.md](references/project-discovery.md) | Mixed projects, shared schemes |
| Swift Package Manager | [swift-package-manager.md](references/swift-package-manager.md) | Cross-compilation, Package.swift syntax |
| xcodebuild Basics | [xcodebuild-basics.md](references/xcodebuild-basics.md) | Build settings, SDK selection |
| Destinations | [destinations.md](references/destinations.md) | All platforms, multiple destinations |
| Testing | [testing.md](references/testing.md) | Test filtering, parallel execution, coverage |
| Archiving | [archiving.md](references/archiving.md) | Archive creation |
| Troubleshooting | [troubleshooting.md](references/troubleshooting.md) | Build/test failures, error recovery |

## Common Pitfalls

1. **swift build with Xcode submodules**: Only works for standalone packages. Use `xcodebuild` with the package's scheme instead.
2. **Missing destination for iOS**: Use `-destination 'generic/platform=iOS'` for builds, or specify a simulator for tests.
3. **Unnecessary workspace flag**: Only use `-workspace` for CocoaPods or multi-project setups. Standard projects with SPM dependencies just use `.xcodeproj`.
4. **Case-sensitive scheme names**: Run `xcodebuild -list` to see exact scheme names.
5. **Outdated simulator names**: Names change with Xcode versions. Run `xcrun simctl list devices available`.
6. **Code signing errors**: Add `CODE_SIGNING_ALLOWED=NO` for builds that don't require signing.

Attribution

kylehugheskylehughes
View sourceSee grades on GitHubMore from kylehughes →
SSkills Directory ProSkills Directory

Get any skill into Claude in one click.

Download any skill as a ZIP for Claude.ai, Claude Desktop, or .claude/skills. $9/mo.

See Pro

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills Directory ProSkills Directory

Get any skill into Claude in one click.

Download any skill as a ZIP for Claude.ai, Claude Desktop, or .claude/skills. $9/mo.

See Pro

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

285172 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

10311 votes
View all in development →