Agent skill
swift-build
SwiftプロジェクトのビルドとテストをXcodeコマンドラインで実行(iOS/macOS対応)。Use when: ビルド、テスト、xcodebuild、swift test を依頼された時。
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/swift-build
SKILL.md
Swift ビルド&テスト(iOS / macOS 対応)
プラットフォーム別コマンド
iOS Simulator
bash
xcodebuild build -scheme YourApp -destination 'platform=iOS Simulator,name=iPhone 16e'
xcodebuild test -scheme YourApp -destination 'platform=iOS Simulator,name=iPhone 16e'
macOS
bash
xcodebuild build -scheme YourApp -destination 'platform=macOS'
xcodebuild test -scheme YourApp -destination 'platform=macOS'
Mac Catalyst
bash
xcodebuild build -scheme YourApp -destination 'platform=macOS,variant=Mac Catalyst'
実行手順
- スキーム確認:
xcodebuild -list - フォーマットチェック:
swift-format lint -r Sources/ - ビルド: 上記プラットフォーム別コマンド
- ユニットテスト: 上記プラットフォーム別コマンド
- 静的解析:
swiftlint lint
Universal Binary(macOS)
bash
# arm64 + x86_64 のユニバーサルビルド
xcodebuild build -scheme YourApp -destination 'platform=macOS' \
ARCHS="arm64 x86_64" ONLY_ACTIVE_ARCH=NO
クリーンビルド
bash
xcodebuild clean build -scheme YourApp -destination 'platform=macOS'
アーカイブ(リリース用)
iOS
bash
xcodebuild archive -scheme YourApp -archivePath ./build/YourApp.xcarchive \
-destination 'generic/platform=iOS'
macOS
bash
xcodebuild archive -scheme YourApp -archivePath ./build/YourApp.xcarchive \
-destination 'platform=macOS'
トラブルシューティング
シミュレーター一覧
bash
xcrun simctl list devices available
利用可能なデスティネーション
bash
xcodebuild -showdestinations -scheme YourApp
Didn't find tool you were looking for?