android-monitor

Monitor Android device state and enforce app time limits via Termux and ADB.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Keeping an AI assistant aware of what is happening on an Android phone normally requires constant polling that burns tokens, or invasive root access. This Skill runs a lightweight bash daemon that watches screen state, foreground apps, battery, and steps, then wakes the AI only when a meaningful event occurs — while also enforcing daily app usage limits with automatic force-stop. ## Core Features & Use Cases - Event-driven device monitoring: A 60-second polling daemon (gaze.sh) detects 11 event types — woke_up, binge_app, low_battery, midnight_phone, left_chat, and more — and pushes compact 5-field triggers to Claude Code through a Monitor hook. - Anti-addiction limiter: app_limit.sh tracks cumulative daily usage per app, warns at 80% of the configured limit via toast, and force-stops the app at 100%, resetting at midnight. - Sub-skills included: a 26+ sensor reference catalog, SMS inbox polling with auto-reply, calendar events with audible CronCreate alarms, and a polling-based proactive check-in pattern. - Use Case: Tell the AI to limit TikTok to 40 minutes a day. It detects your entertainment apps, writes the config, starts the daemon, and from then on warns you near the limit and locks the app when time is up — while also noticing when you are still on your phone at 2 AM. ## Quick Start Ask the AI to set up android-monitor on your Termux device and choose which entertainment apps should get daily time limits.

Frequently Asked Questions about android-monitor

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

FAQPage Schema
How do I monitor the foreground app on Android from a shell script?▼

Use dumpsys activity activities via ADB and parse the topResumedActivity or mResumedActivity field to get the current foreground package name. The skill polls this every 60 seconds, with fallbacks to dumpsys activity top and dumpsys window for OEM variations.

How to set daily time limits for Android apps without root?▼

Track cumulative foreground time per package with a polling script, then run am force-stop and pm suspend through ADB when the configured minute limit is reached. The included app_limit.sh warns at 80% of the limit and locks the app at 100%, resetting at midnight.

Does this work on Xiaomi, Huawei, or Samsung devices?▼

Most commands work across OEMs, but Xiaomi renames the foreground app field, Huawei EMUI 12+ blocks dumpsys activity, and HarmonyOS NEXT removes ADB entirely. The documentation includes a per-command OEM compatibility matrix and Termux background-survival settings per manufacturer.

Why use bash polling instead of Android BroadcastReceiver for app monitoring?▼

Android exposes no shell-visible events for app switches, and BroadcastReceiver or AccessibilityService approaches require a signed APK with special permissions. Polling dumpsys every 60 seconds is the only universal, permission-free method that works from Termux on any device.

Can the AI reply to SMS messages automatically on Android?▼

Yes, using termux-sms-list to poll the inbox and termux-sms-send to reply, combined with a cron job and trigger file. This sub-skill is experimental: dual-SIM popup issues and minute-level timestamp granularity remain unresolved on some devices.

What are the limitations of ADB-based phone monitoring?▼

Polling introduces up to 60 seconds of latency, raw sensor streams are not readable from the command line, and vendor-specific sensors vary by device. The daemon also depends on Termux surviving background restrictions, which requires battery optimization exemptions on most Chinese OEMs.