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 GitHubfusengine/agents
fuse-swift-apple-expert
plugins/swift-apple-expert/skills/swift-build/SKILL.md
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/swift-apple-expert/skills/swift-build/SKILL.md -a claude-code --skill swift-buildInstallation paths:
.claude/skills/swift-build/# 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
<!