← 返回
开发者工具

ADB Connection

Control Android devices via ADB with support for UI layout analysis (uiautomator) and visual feedback (screencap). Use when you need to interact with Android apps, perform UI automation, take screenshots, or run complex ADB command sequences.
通过 ADB 控制 Android 设备,支持 UI 布局分析 (uiautomator) 和视觉反馈 (截图)。适用于需要与 Android 应用交互、执行 UI 自动化、截图或运行复杂 ADB 命令序列的场景。
staticai
开发者工具 clawhub v1.0.0 1 版本 97093 Key: 无需
★ 14
Stars
📥 7,569
下载
💾 1,097
安装
1
版本
#latest

概述

Android Automation

Control and automate Android devices using ADB, uiautomator, and screencap.

Connecting Devices

USB Connection

  1. Enable Developer Options and USB Debugging on the device.
  2. Connect via USB and verify with adb devices.

Wireless Connection (Android 11+)

  1. Enable Wireless Debugging in Developer Options.
  2. Pairing: Find the IP, port, and pairing code in the "Pair device with pairing code" popup.

adb pair :

  1. Connecting: Use the IP and port shown on the main Wireless Debugging screen.

adb connect :

  1. Verify with adb devices.

Common Workflows

Launching an App

Use the monkey tool to launch apps by package name:

adb shell monkey -p -c android.intent.category.LAUNCHER 1

Analyzing the UI

Dump and pull the UI hierarchy to find coordinates:

adb shell uiautomator dump /sdcard/view.xml && adb pull /sdcard/view.xml ./view.xml

Then grep for text or resource IDs to find bounds="[x1,y1][x2,y2]".

Interacting with Elements

  • Tap: adb shell input tap
  • Text: adb shell input text "" (Note: Use %\s for spaces in some environments or handle quoting carefully)
  • Keyevent: adb shell input keyevent (Home: 3, Back: 4, Power: 26, Search: 84, Enter: 66)
  • Swipe: adb shell input swipe

Visual Verification

Take a screenshot to verify the state:

adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png ./screen.png

Tips

  • Search: Use input keyevent 84 to trigger search in many apps.
  • Wait: Use sleep between commands to allow the UI to update.
  • Coordinates: Calculate the center of [x1,y1][x2,y2] for reliable taps.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 00:03 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,720
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,809
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 425 📥 118,013