jpskill.com
🛠️ 開発・MCP コミュニティ

android-use

Android端末をADBとユーザー補助APIで操作し、アプリの自動操作、ボタンのタップ、文字入力、UI操作など、接続されたAndroid端末上で様々なアクションを実行するSkill。

📜 元の英語説明(参考)

This skill enables control of Android devices via ADB and the accessibility API. Use this skill when users want to automate Android phone tasks, control apps remotely, tap buttons, type text, navigate UI, or perform any action on a connected Android device. Requires ADB and a connected device with USB debugging enabled.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Android端末をADBとユーザー補助APIで操作し、アプリの自動操作、ボタンのタップ、文字入力、UI操作など、接続されたAndroid端末上で様々なアクションを実行するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o android-use.zip https://jpskill.com/download/10167.zip && unzip -o android-use.zip && rm android-use.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10167.zip -OutFile "$d\android-use.zip"; Expand-Archive "$d\android-use.zip" -DestinationPath $d -Force; ri "$d\android-use.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して android-use.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → android-use フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Android の使用

概要

このスキルにより、Claude は ADB (Android Debug Bridge) と Android Accessibility API (uiautomator) を使用して Android デバイスを制御できます。これは、デバイスの UI 階層を構造化された XML テキストとしてキャプチャし、インタラクティブな要素を座標とともに解析し、タップ、入力、スワイプ、ナビゲーションなどのアクションを実行することで機能します。

重要: このスキルは、画像/スクリーンショット処理ではなく、テキストベースの UI 自動化を使用します。

テキストベースである理由 (スクリーンショットではない理由)?

アプローチ コスト 速度 精度
スクリーンショット + Vision ~$0.15/アクション 3-5秒 70-80%
テキスト UI ダンプ ~$0.01/アクション <1秒 99%+

Android Accessibility API は、以下を含む構造化された XML を提供します。

  • 要素のテキストコンテンツ (正確、OCR エラーなし)
  • 正確な座標 (決定的)
  • クリック可能/フォーカス可能な状態
  • 識別用のリソース ID

スクリーンショットは、以下の場合の最終手段としてのみ使用してください。

  • UI テキストが曖昧または不明確な場合
  • 視覚的な状態 (色、画像) を確認する必要がある場合
  • テキストダンプが空ですが、画面にコンテンツが明確に表示されている場合

前提条件

このスキルを使用する前に、以下を確認してください。

  1. ADB がインストールされていること: brew install android-platform-tools (macOS) または同等のもの
  2. デバイスが接続されていること: USB 経由で接続し、開発者向けオプションで「USB デバッグ」が有効になっていること
  3. デバイスが認証されていること: 最初に接続するときに、デバイスで RSA キープロンプトを受け入れること

接続を確認するには:

adb devices -l

クイックスタートワークフロー

Android デバイスを制御するには:

  1. 画面の状態を取得 - UI 階層をテキストとしてダンプ
  2. 要素を解析 - 座標を持つインタラクティブなコンポーネントを抽出
  3. アクションを決定 - テキストコンテンツに基づいて、ターゲット要素を見つける
  4. アクションを実行 - タップ、入力、スワイプ、戻る、ホーム
  5. 待機して繰り返す - UI が更新されるのを待ってから、再評価する

コアコマンド

デバイス管理

# 接続されているすべてのデバイスをリスト表示
adb devices -l

# 特定のデバイスをターゲットにする (複数接続されている場合)
adb -s <DEVICE_ID> <command>

UI インスペクション (テキストベース)

# UI 階層をデバイスにダンプ
adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml

# ローカルマシンにプル
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml

# インタラクティブな要素を解析して抽出
python3 scripts/parse_ui.py /tmp/screen.xml

便利なワンライナー:

adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

パーサーは、次のようなインタラクティブな要素を出力します。

TAPPABLE:
  👆 "Submit" @ (540, 1200)
  👆 "Cancel" @ (200, 1200)
  👆 [search_button] @ (980, 156)

INPUT FIELDS:
  ⌨️ "Enter email" @ (540, 600)

TEXT/INFO:
  👁️ "Welcome back, John" @ (540, 300)

アクション

# 座標をタップ
adb shell input tap <x> <y>

# テキストを入力 (スペースには %s を使用)
adb shell input text "hello%sworld"

# キーを押す
adb shell input keyevent KEYCODE_HOME      # ホームボタン
adb shell input keyevent KEYCODE_BACK      # 戻るボタン
adb shell input keyevent KEYCODE_ENTER     # Enter キー
adb shell input keyevent KEYCODE_DEL       # Backspace

# スワイプ (x1, y1 から x2, y2 まで duration_ms ミリ秒かけて)
adb shell input swipe <x1> <y1> <x2> <y2> <duration_ms>

# 長押し (同じ開始/終了でスワイプ)
adb shell input swipe <x> <y> <x> <y> 1000

アプリ管理

# パッケージ名でアプリを起動 (最も簡単)
adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1

# 特定のアクティビティでアプリを起動
adb shell am start -n <package>/<activity>

# インストールされているパッケージをリスト表示
adb shell pm list packages | grep <search>

# アプリを強制停止
adb shell am force-stop <package>

標準ワークフロー

ステップ 1: 現在の画面の状態を取得 (テキストのみ)

adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

これにより、座標を持つすべてのインタラクティブな要素のテキストリストが得られます。

ステップ 2: ターゲット要素を見つける

解析された出力から、必要な要素を特定します。

  • テキストコンテンツで一致: "Submit", "Login", "Search"
  • リソース ID で一致: [login_button], [search_field]
  • タイプで一致: Button, EditText, TextView

ステップ 3: アクションを実行

# (540, 1200) にある "Submit" ボタンをタップするには
adb -s <DEVICE_ID> shell input tap 540 1200

# フィールドに入力するには - まずタップしてから入力
adb -s <DEVICE_ID> shell input tap 540 600
adb -s <DEVICE_ID> shell input text "user@email.com"

ステップ 4: 待機して繰り返す

# UI が更新されるまで 1〜2 秒待機
sleep 2

# 再度ダンプして再評価
adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

スクリーンショットを使用する場合 (最終手段のみ)

スクリーンショットを撮るのは、以下の場合のみです。

  1. UI ダンプが空/不完全を返すのに、画面にコンテンツがあることがわかっている場合
  2. 何か視覚的なもの (画像がロードされたか、色の状態) を確認する必要がある場合
  3. テキスト要素が曖昧で、視覚的なコンテキストが必要な場合
  4. ユーザーが明示的に画面を「見る」ように要求した場合
# スクリーンショットコマンド (控えめに使用 - 処理に約 15 倍のコストがかかります)
adb -s <DEVICE_ID> shell screencap -p /sdcard/screen.png && \
adb -s <DEVICE_ID> pull /sdcard/screen.png /tmp/screen.png

一般的なパターン

アプリを開いてナビゲートする

# 1. アプリを起動
adb -s DEVICE shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1

# 2. 起動を待機
sleep 2

# 3. UI の状態を取得 (テキスト)
adb -s DEVICE shell uiautomator dump /sdcard/window_dump.xml
adb -s DEVICE pull /sdcard/window_dump.xml /tmp/screen.xml
python3 scripts/parse_ui.py /tmp/screen.xml

# 4. テキスト出力に基づいてターゲット要素を見つけてタップ
adb -s DEVICE shell input tap <x> <y>

アプリ内を検索する

# 1. UI ダンプで検索フィールドを見つける
# 出力: ⌨️ "Search" @ (540, 200)

# 2. 検索フィールドをタップ
adb shell input tap 540 2
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Android Use

Overview

This skill enables Claude to control Android devices using ADB (Android Debug Bridge) and the Android Accessibility API (uiautomator). It works by capturing the device's UI hierarchy as structured XML text, parsing interactive elements with their coordinates, and executing actions like tapping, typing, swiping, and navigation.

IMPORTANT: This skill uses TEXT-BASED UI automation, NOT image/screenshot processing.

Why Text-Based (Not Screenshots)?

Approach Cost Speed Accuracy
Screenshots + Vision ~$0.15/action 3-5s 70-80%
Text UI Dump ~$0.01/action <1s 99%+

The Android Accessibility API provides structured XML with:

  • Element text content (exact, no OCR errors)
  • Precise coordinates (deterministic)
  • Clickable/focusable state
  • Resource IDs for identification

Only use screenshots as a LAST RESORT when:

  • UI text is ambiguous or unclear
  • You need to verify visual state (colours, images)
  • Text dump is empty but screen clearly has content

Prerequisites

Before using this skill, ensure:

  1. ADB installed: brew install android-platform-tools (macOS) or equivalent
  2. Device connected: Via USB with "USB debugging" enabled in Developer Options
  3. Device authorised: Accept the RSA key prompt on the device when first connecting

To verify connection:

adb devices -l

Quick Start Workflow

To control an Android device:

  1. Get screen state - Dump UI hierarchy as text
  2. Parse elements - Extract interactive components with coordinates
  3. Decide action - Based on text content, find target element
  4. Execute action - Tap, type, swipe, back, home
  5. Wait & repeat - Allow UI to update, then reassess

Core Commands

Device Management

# List all connected devices
adb devices -l

# Target specific device (when multiple connected)
adb -s <DEVICE_ID> <command>

UI Inspection (Text-Based)

# Dump UI hierarchy to device
adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml

# Pull to local machine
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml

# Parse and extract interactive elements
python3 scripts/parse_ui.py /tmp/screen.xml

One-liner for convenience:

adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

The parser outputs interactive elements like:

TAPPABLE:
  👆 "Submit" @ (540, 1200)
  👆 "Cancel" @ (200, 1200)
  👆 [search_button] @ (980, 156)

INPUT FIELDS:
  ⌨️ "Enter email" @ (540, 600)

TEXT/INFO:
  👁️ "Welcome back, John" @ (540, 300)

Actions

# Tap at coordinates
adb shell input tap <x> <y>

# Type text (use %s for spaces)
adb shell input text "hello%sworld"

# Press keys
adb shell input keyevent KEYCODE_HOME      # Home button
adb shell input keyevent KEYCODE_BACK      # Back button
adb shell input keyevent KEYCODE_ENTER     # Enter key
adb shell input keyevent KEYCODE_DEL       # Backspace

# Swipe (x1, y1 to x2, y2 over duration_ms)
adb shell input swipe <x1> <y1> <x2> <y2> <duration_ms>

# Long press (swipe with same start/end)
adb shell input swipe <x> <y> <x> <y> 1000

App Management

# Launch app by package name (simplest)
adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1

# Launch app with specific activity
adb shell am start -n <package>/<activity>

# List installed packages
adb shell pm list packages | grep <search>

# Force stop app
adb shell am force-stop <package>

Standard Workflow

Step 1: Get Current Screen State (TEXT ONLY)

adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

This gives you a text list of all interactive elements with coordinates.

Step 2: Find Target Element

From the parsed output, identify the element you need:

  • Match by text content: "Submit", "Login", "Search"
  • Match by resource ID: [login_button], [search_field]
  • Match by type: Button, EditText, TextView

Step 3: Execute Action

# To tap "Submit" button at (540, 1200)
adb -s <DEVICE_ID> shell input tap 540 1200

# To type in a field - first tap it, then type
adb -s <DEVICE_ID> shell input tap 540 600
adb -s <DEVICE_ID> shell input text "user@email.com"

Step 4: Wait and Repeat

# Wait 1-2 seconds for UI to update
sleep 2

# Dump again and reassess
adb -s <DEVICE_ID> shell uiautomator dump /sdcard/window_dump.xml && \
adb -s <DEVICE_ID> pull /sdcard/window_dump.xml /tmp/screen.xml && \
python3 scripts/parse_ui.py /tmp/screen.xml

When to Use Screenshots (LAST RESORT ONLY)

Only take a screenshot if:

  1. UI dump returns empty/incomplete but you know the screen has content
  2. You need to verify something visual (image loaded, colour state)
  3. Text elements are ambiguous and you need visual context
  4. User explicitly asks to "see" the screen
# Screenshot command (USE SPARINGLY - costs ~15x more to process)
adb -s <DEVICE_ID> shell screencap -p /sdcard/screen.png && \
adb -s <DEVICE_ID> pull /sdcard/screen.png /tmp/screen.png

Common Patterns

Opening an App and Navigating

# 1. Launch app
adb -s DEVICE shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1

# 2. Wait for launch
sleep 2

# 3. Get UI state (text)
adb -s DEVICE shell uiautomator dump /sdcard/window_dump.xml
adb -s DEVICE pull /sdcard/window_dump.xml /tmp/screen.xml
python3 scripts/parse_ui.py /tmp/screen.xml

# 4. Find and tap target element based on text output
adb -s DEVICE shell input tap <x> <y>

Searching in an App

# 1. Find search field in UI dump
# Output shows: ⌨️ "Search" @ (540, 200)

# 2. Tap search field
adb shell input tap 540 200

# 3. Type search query
adb shell input text "cheesecake"

# 4. Press enter
adb shell input keyevent KEYCODE_ENTER

Scrolling to Find Elements

If an element isn't visible in the UI dump, scroll and re-dump:

# Scroll down
adb shell input swipe 540 1500 540 500 300

# Wait and re-dump
sleep 1
adb shell uiautomator dump /sdcard/window_dump.xml
# ... parse again

Handling Popups/Dialogs

Popups appear in UI dump with their own elements:

👆 "Allow" @ (700, 1200)
👆 "Deny" @ (300, 1200)

Just tap the appropriate button coordinates.

Parser Output Reference

The parse_ui.py script outputs elements grouped by action type:

TAPPABLE (clickable=true)

Elements that respond to taps: buttons, links, icons

👆 "Button Text" @ (x, y)
👆 [resource_id] @ (x, y)

INPUT FIELDS (EditText)

Text input fields

⌨️ "Placeholder text" @ (x, y)

TEXT/INFO (readable)

Non-interactive text elements (limited to 10)

👁️ "Display text" @ (x, y)

JSON Output

For programmatic use:

python3 scripts/parse_ui.py /tmp/screen.xml --json

Returns:

[
  {
    "id": "com.app:id/submit_btn",
    "text": "Submit",
    "type": "Button",
    "bounds": "[400,1100][680,1300]",
    "center": [540, 1200],
    "clickable": true,
    "action": "tap"
  }
]

Troubleshooting

"error: device not found"

  • Check USB connection
  • Run adb devices to verify
  • Try adb kill-server && adb start-server

UI dump returns empty/incomplete

  • Screen may be loading - wait and retry
  • Some apps have accessibility restrictions
  • Only then consider a screenshot to diagnose

Taps not registering

  • Verify coordinates are within screen bounds
  • Check if element is actually clickable
  • Some overlays may intercept touches

Text input issues

  • Replace spaces with %s
  • Special characters may need escaping
  • For passwords, some apps block programmatic input

Element not found in dump

  • It may be off-screen - try scrolling
  • It may be in a WebView (limited accessibility)
  • It may be loading - wait and retry

Reference

Common Package Names

App Package
Uber Eats com.ubercab.eats
DoorDash com.dd.dasher
Chrome com.android.chrome
Settings com.android.settings
Messages com.google.android.apps.messaging

Common Keycodes

Key Code
Home KEYCODE_HOME
Back KEYCODE_BACK
Enter KEYCODE_ENTER
Delete KEYCODE_DEL
Tab KEYCODE_TAB
Escape KEYCODE_ESCAPE

Resources

  • scripts/parse_ui.py - Parses Android UI XML and outputs interactive elements
  • Based on android-action-kernel approach