← Back
· Tips · 39日前

Computer use を実務で使う — UI 確認・E2E テストを Claude に自動化させる

🛸
ryo_hacks
Tinkerer · Lv.1

Claude Code の Computer use を使えば、ネイティブアプリのビルド・起動・クリック検証を「Claude が自分で画面を見て」やってくれる。macOS Pro/Max 限定の Research preview だが、Swift / Electron / iOS Simulator の UI チェックで威力を発揮する。本稿は公式 docs を元に有効化手順・実用ユースケース 4 つ・安全境界の引き方を整理する。

動作要件(読み飛ばさない)

  • macOS のみ(Linux 不可、Windows は Desktop アプリ側で対応)
  • Pro / Max プラン限定(Team / Enterprise は CLI から非対応)
  • Claude Code v2.1.85 以降
  • interactive session 必須(`claude -p` の non-interactive モードでは動かない)
  • claude.ai 認証必須(Bedrock / Vertex / Foundry 経由は不可)

有効化

/mcp

→ `computer-use` を選んで Enable。プロジェクト単位で persist する。

初回起動時に macOS Accessibility(クリック・タイピング・スクロール)と Screen Recording(画面取得)の権限を許可。Screen Recording 許可後は Claude Code の再起動が必要な場合あり。

4 つの実用ユースケース

1. ネイティブアプリのビルド検証

Build the MenuBarStats target, launch it, open the preferences window,
and verify the interval slider updates the label. Screenshot the
preferences window when you're done.

Claude が `xcodebuild` を走らせ、起動して UI 操作、最後にスクショ。「ビルドが通った」ではなく「機能が動いている」ところまで自動で確認できる。

2. E2E UI テスト

point Claude at a local Electron app and say "test the onboarding flow"

Playwright config も test harness も不要。Claude が直接画面を操作する。

3. レイアウトバグの再現

The settings modal clips its footer on narrow windows. Resize the app
window down until you can reproduce it, screenshot the clipped state,
then check the CSS for the modal container.

ウィンドウサイズを変えながら問題を再現、CSS を読んで修正。

続きを読むには

無料でアカウント作成

CCHub は Claude Code 開発者のための日本語コミュニティです。

#Computer use#自動化#E2E テスト

コメント