Web Analytics

ios-simulator-skill

⭐ 171 stars Japanese by conorluddy

iOSシミュレーター用スキル for Claude Code

iOSアプリのテストとビルドのための本番対応オートメーション。人間の開発者とAIエージェントの両方に最適化された21のスクリプト。

これは基本的に私のXCode MCPのスキル版です: https://github.com/conorluddy/xc-mcp

MCPはアクティブ時に多くのトークンをコンテキストウィンドウに読み込みますが、非常にうまく機能するようです。スキルはコンテキストを一切読み込みません。次はプラグインを作成してバランスを探ります...

更新: プラグイン版では異なるツールグループのMCPを簡単に無効化できます。使用中のツールだけを有効にしてコンテキストウィンドウを最適化しましょう。例: xcodebuild https://github.com/conorluddy/xclaude-plugin

何をするか

UIが変わると壊れるピクセルベースのナビゲーションの代わりに:

# Fragile - breaks if UI changes
idb ui tap 320 400

Robust - finds by meaning

python scripts/navigator.py --find-text "Login" --tap
アクセシビリティAPI上のセマンティックナビゲーションを使用し、座標ではなく要素の意味に基づいて操作します。異なる画面サイズに対応し、UIの再設計にも耐えます。

特徴

インストール

Claude Code Skillとして

# Personal installation
git clone https://github.com/conorluddy/ios-simulator-skill.git ~/.claude/skills/ios-simulator-skill

Project installation

git clone https://github.com/conorluddy/ios-simulator-skill.git .claude/skills/ios-simulator-skill

クロードコードを再起動します。スキルは自動的に読み込まれます。

リリースから

# Download latest release
curl -L https://github.com/conorluddy/ios-simulator-skill/releases/download/vX.X.X/ios-simulator-skill-vX.X.X.zip -o skill.zip

Extract

unzip skill.zip -d ~/.claude/skills/ios-simulator-skill

前提条件

クイックスタート

# 1. Check environment
bash ~/.claude/skills/ios-simulator-skill/scripts/sim_health_check.sh

2. Launch your app

python ~/.claude/skills/ios-simulator-skill/scripts/app_launcher.py --launch com.example.app

3. See what's on screen

python ~/.claude/skills/ios-simulator-skill/scripts/screen_mapper.py

Output:

Screen: LoginViewController (45 elements, 7 interactive)

Buttons: "Login", "Cancel", "Forgot Password"

TextFields: 2 (0 filled)

4. Tap login button

python ~/.claude/skills/ios-simulator-skill/scripts/navigator.py --find-text "Login" --tap

5. Enter text

python ~/.claude/skills/ios-simulator-skill/scripts/navigator.py --find-type TextField --enter-text "user@test.com"

6. Check accessibility

python ~/.claude/skills/ios-simulator-skill/scripts/accessibility_audit.py

カテゴリ別に整理された21のスクリプト

ビルド&開発

ナビゲーション&インタラクション

テスト&解析

高度なテスト&権限管理

デバイスライフサイクル

完全なリファレンスはSKILL.mdを参照してください。

Claude Codeとの連携方法

Claude Codeはリクエストに基づいて自動的にこのスキルの使用を検出します。手動で呼び出す必要はありません。

会話例:

You: "Set up my iOS app for testing"
Claude: [Uses simctl_boot.py and app_launcher.py automatically]

You: "Tap the login button" Claude: [Uses navigator.py to find and tap]

You: "Check if the form is accessible" Claude: [Uses accessibility_audit.py]

必要に応じてスクリプトを手動で実行することもできます。

使用例

例1:ログインフロー

# Launch app
python scripts/app_launcher.py --launch com.example.app

Map screen to find fields

python scripts/screen_mapper.py

Enter credentials

python scripts/navigator.py --find-type TextField --index 0 --enter-text "user@test.com" python scripts/navigator.py --find-type SecureTextField --enter-text "password"

Tap login

python scripts/navigator.py --find-text "Login" --tap

Verify accessibility

python scripts/accessibility_audit.py

例 2: テストドキュメンテーション

# Record test execution
python scripts/test_recorder.py --test-name "Login Flow" --output test-reports/

Generates:

- Screenshots per step

- Accessibility trees

- Markdown report with timing

例3: ビジュアルテスト

# Capture baseline
python scripts/app_state_capture.py --output baseline/

Make changes...

Compare

python scripts/visual_diff.py baseline/screenshot.png current/screenshot.png

例4:権限テスト

# Grant permissions
python scripts/privacy_manager.py --bundle-id com.example.app --grant camera,location

Test app behavior with permissions...

Revoke permissions

python scripts/privacy_manager.py --bundle-id com.example.app --revoke camera,location

例 5: CI/CDにおけるデバイスライフサイクル

# Create test device
DEVICE_ID=$(python scripts/simctl_create.py --device "iPhone 16 Pro" --json | jq -r '.new_udid')

Run tests

python scripts/build_and_test.py --project MyApp.xcodeproj

Clean up

python scripts/simctl_delete.py --udid $DEVICE_ID --yes

設計原則

セマンティックナビゲーション: ピクセル座標ではなく意味(テキスト、タイプ、ID)で要素を検出。UI変更に強く、デバイスサイズを問わず動作。

トークン効率: デフォルト出力は3~5行。詳細は --verbose、機械解析は --json を使用。生ツール比で96%削減。

アクセシビリティファースト: iOSアクセシビリティAPIを基盤に信頼性向上。アクセシビリティ利用者に優れ、自動化にも強固。

ゼロコンフィギュレーション: XcodeがあればmacOS上で即動作。複雑な設定や設定ファイル不要。

構造化データ: スクリプトは生ログでなくJSONや整形テキストを出力。解析、統合、理解が容易。

自動学習: ビルドシステムがデバイスの好みを学習し、次回に記憶。

要件

システム:

オプション:

ドキュメント

出力効率

すべてのスクリプトはデフォルトで出力を最小化:

| タスク | 生ツール | 本スキル | 削減率 | |------|-----------|-----------|---------| | 画面解析 | 200行以上 | 5行 | 97.5% |

| ボタンを見つけてタップ | 100行以上 | 1行 | 99% | | テキスト入力 | 50行以上 | 1行 | 98% | | ログインフロー | 400行以上 | 15行 | 96% |

この効率性により、AIエージェントの会話は集中かつコスト効率が良くなります。

トラブルシューティング

環境の問題

# Run health check
bash ~/.claude/skills/ios-simulator-skill/scripts/sim_health_check.sh

Checks: macOS, Xcode, simctl, IDB, Python, simulators, packages

スクリプトヘルプ

# All scripts support --help
python scripts/navigator.py --help
python scripts/accessibility_audit.py --help

要素が見つからない場合

# Use verbose mode to see all elements
python scripts/screen_mapper.py --verbose

Check for exact text match

python scripts/navigator.py --find-text "Exact Button Text" --tap

貢献について

貢献は以下を守ること:

ライセンス

MITライセンス - 商用利用および配布を許可。

サポート

---

AIエージェントのために構築。開発者に最適化。

--- Tranlated By Open Ai Tx | Last indexed: 2025-12-18 ---