mcpField
D
debugger-agent

debugger-agent

github.com/patrickserrano開発1367 回インストール41 週間前に更新
リポジトリ

debugger-agent について

debugger-agent は、起動済みのシミュレーターで iOS アプリをビルド、実行、デバッグするスキルです。Xcode のコマンドラインツールを使い、画面操作やログ取得を案内します。

主な機能

  1. 01xcodebuild による iOS プロジェクトのビルド
  2. 02シミュレーターへのアプリのインストールと起動
  3. 03アプリまたはシミュレーターのログ取得
  4. 04スクリーンショットと動画の記録
  5. 05ディープリンクの起動と通知の送信

活用シーン

  1. 01シミュレーターでの iOS アプリの問題再現
  2. 02テスト中のアプリログの確認
  3. 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

コメント