Back to Skills

swift-build

verified

Build, archive, code signing, and App Store distribution for iOS/macOS apps. Use when configuring build settings, signing, TestFlight, notarization, or CI/CD pipelines.

View on GitHub

Marketplace

fusengine-plugins

fusengine/agents

Plugin

fuse-swift-apple-expert

development

Repository

fusengine/agents

plugins/swift-apple-expert/skills/swift-build/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/swift-apple-expert/skills/swift-build/SKILL.md -a claude-code --skill swift-build

Installation paths:

Claude
.claude/skills/swift-build/
Powered by add-skill CLI

Instructions

# Swift Build & Distribution

## Code Signing (Automatic - Recommended)

```bash
# Xcode: Target → General → "Automatically manage signing" ✓
# Select Development Team

# Command line
xcodebuild archive \
  -scheme MyApp \
  -archivePath ./build/MyApp.xcarchive \
  -allowProvisioningUpdates \
  DEVELOPMENT_TEAM="XXXXXXXXXX"
```

## Archive & Export

```bash
# Archive
xcodebuild archive \
  -workspace MyApp.xcworkspace \
  -scheme MyApp \
  -configuration Release \
  -archivePath ./build/MyApp.xcarchive

# Export IPA
xcodebuild -exportArchive \
  -archivePath ./build/MyApp.xcarchive \
  -exportPath ./build \
  -exportOptionsPlist ExportOptions.plist
```

**ExportOptions.plist:**
```xml
<dict>
    <key>method</key>
    <string>app-store</string>
    <key>teamID</key>
    <string>XXXXXXXXXX</string>
</dict>
```

## Privacy Manifest (REQUIRED)

**PrivacyInfo.xcprivacy:**
```xml
<dict>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array><string>CA92.1</string></array>
        </dict>
    </array>
</dict>
```

## macOS Notarization

```bash
# Store credentials
xcrun notarytool store-credentials "notary-profile" \
  --apple-id "dev@company.com" \
  --team-id "XXXXXXXXXX"

# Submit
xcrun notarytool submit ./MyApp.dmg \
  --keychain-profile "notary-profile" --wait

# Staple ticket
xcrun stapler staple ./MyApp.dmg
```

## Build Configurations

**Release.xcconfig:**
```ini
GCC_OPTIMIZATION_LEVEL = s
SWIFT_OPTIMIZATION_LEVEL = -O
SWIFT_COMPILATION_MODE = wholemodule
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
```

## fastlane Beta Deploy

```ruby
lane :beta do
  match(type: "appstore", readonly: true)
  increment_build_number
  build_app(scheme: "MyApp", export_method: "app-store")
  upload_to_testflight(groups: ["Beta Testers"])
end
```

## Common Info.plist Keys

```xml
<!

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2537 chars