phone-elements

Parse Android UI element trees via uiautomator to locate and tap elements by coordinates.

10|2|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/xvxv-stack7/android-claude-agent --skill phone-elements-xvxv-stack7
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: phone-elements
Source: https://github.com/xvxv-stack7/android-claude-agent/tree/main/skills/phone-elements
Command: npx skills add https://github.com/xvxv-stack7/android-claude-agent --skill phone-elements-xvxv-stack7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finding the exact pixel coordinates of a button, text field, or menu on an Android screen normally requires taking a screenshot and running vision analysis, which takes 7-8 seconds. This Skill dumps the UI hierarchy with uiautomator and parses the XML to return precise element coordinates in about 1 second. ## Core Features & Use Cases - Element Search: Find UI elements by text, resource ID, or class name and get their center coordinates, size, and clickability as JSON. - One-Command Tap: Combine search and tap in a single invocation, e.g. find the "确认" button and tap it automatically. - Dual-Channel Resilience: Tries Shizuku rish first, falls back to ADB over 127.0.0.1:5555, and handles OEM quirks like MIUI's non-zero exit codes. - Use Case: An AI agent automating an Android app needs to press a submit button. Instead of screenshot analysis, it runs the script with the button text, receives the coordinates, and taps within one second. ## Quick Start Ask the AI to find the button labeled "确认" on the current Android screen and tap it using the phone-elements script.

Frequently Asked Questions about phone-elements

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and tap a button on Android from the command line?▼

Run the elements.py script with --text followed by the button label and the --tap flag. It dumps the UI hierarchy via uiautomator, parses the XML, computes the element's center coordinates, and issues an input tap command through Shizuku or ADB.

uiautomator dump vs screenshot with vision AI for UI automation?▼

uiautomator dump returns structured XML with exact element bounds in about 1 second, while screenshot plus vision analysis takes 7-8 seconds. Use uiautomator when you know the target text or ID; use vision only for unknown layouts or scene understanding.

Does uiautomator dump work on Xiaomi MIUI or HyperOS?▼

Yes, but MIUI has a known bug where uiautomator dump returns a non-zero exit code even when the XML output is valid. The script handles this by checking the XML content rather than the exit code, so parsing succeeds on MIUI and HyperOS devices.

Why does uiautomator dump to /dev/tty fail on some phones?▼

Some OEMs like vivo OriginOS do not support dumping to /dev/tty. The script automatically falls back to a file-based dump at /sdcard/ui_dump.xml and reads it back, so it works across AOSP, Samsung One UI, vivo, and Xiaomi devices.

What do I need installed to run uiautomator element parsing?▼

You need either Shizuku with the rish command or ADB connected over TCP at 127.0.0.1:5555, plus Python 3. The XML parser uses xml.etree.ElementTree from the Python standard library, so no third-party packages are required.