phone-sensors

Query Android device state including foreground app, screen, battery, and sensors via ADB.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It gives an AI agent direct read access to an Android phone's live state—foreground app, screen wakefulness, battery, steps, ambient light, WiFi, signal, and memory—without root, a PC, or WiFi, using only local ADB over the 127.0.0.1 loopback. ## Core Features & Use Cases - Device State Queries: Read the foreground app, screen state (Awake/Asleep), battery level and temperature, charging source, total RAM, WiFi SSID, and cellular signal strength via adb dumpsys commands. - Sensor Readings: Capture pedometer step counts and ambient light values through termux-api's termux-sensor command. - Full Snapshot: Run a single combined command block that prints screen, foreground app, battery, steps, and memory in one pass. - Use Case: An autonomous on-phone agent checks whether the screen is still awake at midnight and which app is in the foreground, then decides whether to notify the user about late-night usage. ## Quick Start Ask the AI to check my phone's current foreground app, screen state, and battery level using the phone-sensors skill.

Frequently Asked Questions about phone-sensors

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

FAQPage Schema
How do I check the foreground app on Android with ADB?▼

Run adb shell dumpsys activity activities and grep for topResumedActivity to get the currently focused app's package name. This works without root on most AOSP-based ROMs, though MIUI and EMUI may use different field names.

How to read Android battery level from the command line?▼

Use adb shell dumpsys battery and grep for level and temperature to get charge percentage and battery temperature. Grepping for USB powered, AC powered, or Wireless powered reveals the current charging source.

Does this work without root, PC, or WiFi?▼

Yes, it uses ADB over the 127.0.0.1:5555 loopback after a one-time wireless debugging setup switches adbd to TCP mode. Step counting and ambient light additionally need the termux-api package installed.

Why does foreground app detection fail on MIUI or EMUI?▼

MIUI and HyperOS use different field names for the top activity, and EMUI 12+ blocks dumpsys activity entirely. On MIUI a manual fix for the detection field is required; on EMUI the monitoring capability is limited.

What sensors can termux-sensor read on Android?▼

termux-sensor can read hardware sensors exposed by the device, including the pedometer for step counts and the ambient light sensor. Readings use a timeout flag so the command returns a single sample instead of streaming indefinitely.