debugger-agent について
debugger-agent は、起動済みのシミュレーターで iOS アプリをビルド、実行、デバッグするスキルです。Xcode のコマンドラインツールを使い、画面操作やログ取得を案内します。
主な機能
- 01xcodebuild による iOS プロジェクトのビルド
- 02シミュレーターへのアプリのインストールと起動
- 03アプリまたはシミュレーターのログ取得
- 04スクリーンショットと動画の記録
- 05ディープリンクの起動と通知の送信
活用シーン
- 01シミュレーターでの iOS アプリの問題再現
- 02テスト中のアプリログの確認
- 03デバッグ用のシミュレーター画面の記録
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ patrickserrano/ skills --skill debugger-agentインストール後、Claude Code で/debugger-agentを入力して読み込まれたか確認します。
詳細
iOS デバッガーエージェント
概要
起動済みシミュレーターで iOS プロジェクトをビルドして実行し、UI を操作してデバッグ用のログを取得します。
前提条件
- コマンドラインツールを含む Xcode がインストールされていること
- iOS シミュレーターが起動していること(
xcrun simctl list devicesで確認) .xcodeprojまたは.xcworkspaceを含むプロジェクト
基本的なワークフロー
1) 起動済みシミュレーターを確認する
xcrun simctl list devices | grep -E "Booted"
起動済みのシミュレーターがない場合は、ユーザーに起動を依頼します。
xcrun simctl boot "iPhone 15 Pro"
2) プロジェクトをビルドする
ワークスペースの場合:
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
プロジェクトの場合:
xcodebuild -project MyApp.xcodeproj -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
3) アプリをインストールして起動する
ビルド済みのアプリを探します。
find ~/Library/Developer/Xcode/DerivedData -name "*.app" -path "*Debug-iphonesimulator*" | head -1
シミュレーターにインストールします。
xcrun simctl install booted /path/to/MyApp.app
アプリを起動します。
xcrun simctl launch booted com.example.MyApp
4) ログを取得する
アプリのログをストリーミングします。
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.example.MyApp"' --level debug
または、シミュレーターのすべてのログを取得します。
xcrun simctl spawn booted log stream --level debug
UI 操作
スクリーンショットを撮る
xcrun simctl io booted screenshot screenshot.png
ビデオを録画する
xcrun simctl io booted recordVideo video.mp4
# Press Ctrl+C to stop recording
シミュレーターで URL を開く
xcrun simctl openurl booted "myapp://deeplink"
プッシュ通知を送信する
xcrun simctl push booted com.example.MyApp notification.apns
トラブルシューティング
- ビルドに失敗する:
xcodebuild -listでスキーム名を確認します - アプリが起動しない:
defaults read /path/to/MyApp.app/Info.plist CFBundleIdentifierでバンドル ID を確認します - シミュレーターが見つからない:
xcrun simctl list devices availableで利用可能なシミュレーターを一覧表示します - クリーンビルド:
xcodebuild cleanを実行するか、DerivedData を削除します
よく使うコマンドのリファレンス
| タスク | コマンド |
|---|---|
| シミュレーターを一覧表示 | xcrun simctl list devices |
| シミュレーターを起動 | xcrun simctl boot "iPhone 15 Pro" |
| シミュレーターを終了 | xcrun simctl shutdown booted |
| シミュレーターを消去 | xcrun simctl erase booted |
| アプリをインストール | xcrun simctl install booted /path/to/App.app |
| アプリをアンインストール | xcrun simctl uninstall booted com.example.app |
| アプリを起動 | xcrun simctl launch booted com.example.app |
| アプリを終了 | xcrun simctl terminate booted com.example.app |
| アプリのコンテナを取得 | xcrun simctl get_app_container booted com.example.app |
コメント
Markdown 対応