agnostic-skills

device-testing

device-testing

Drive an attached Android phone or iPhone from the terminal with one device command set, and prove every action worked.

Quick start

  1. Copy the folder into your harness: install a skill.

  2. Set your app ids, then list devices:

    cp config.example.env ~/.config/device-testing/config.env   # set APP_ANDROID_PACKAGE, APP_IOS_BUNDLE_ID
    python3 <skill>/scripts/device.py devices
  3. Try a check, a screenshot and a proven tap:

    D=<skill>/scripts/device.py
    python3 $D check
    python3 $D shot
    python3 $D tap 540 1200 --wait 'Opened.*Menu'

What's inside

Script / fileWhat it does
scripts/device.pyThe device CLI: one command set for an attached Android phone or iPhone
scripts/ios-sim-harness.pyiOS simulator harness: build a tiny UIKit harness around plugin .mm files and drive it
scripts/device_tap_nudge.pyPostToolUse (Bash) hook: nudges toward a plan or the device-runner after N single device inputs in a row
scripts/device_testing/ios_recorder.pyiOS screen recording helper used by device.py record
scripts/device_testing/Per-platform backends (Android, iOS, iOS hid/WDA/media), plans, nav profiles
scripts/ios_media_helper/Xcode project for the iOS Photos helper behind device media
agents/device-runner.mdSubagent profile that runs a whole device pass and returns a verdict and evidence paths
references/Command matrix, every command's arguments, capture, plans, iOS, simulator, extending
config.example.envEvery config key, commented

How it works

device routes each command to the attached phone's platform. You run a flow as one device run <plan> call instead of one input per turn.

State comes from logs (log, wait <regex>, nav <id>). Screenshots are evidence: shot also writes a small copy to read.

Configuration

Copy config.example.env to ~/.config/device-testing/config.env, or point DEVICE_TESTING_CONFIG elsewhere. Every key can come from the environment. Never commit a filled-in copy.

KeyDefaultMeaning
APP_ANDROID_PACKAGE, APP_IOS_BUNDLE_IDemptyYour app ids (set at least these)
DEVICE_<ALIAS>_SERIALnoneOptional device alias; on iOS the serial is the UDID
DEVICE_IOS_INPUTautohid on iOS 27+, else server; or force one
DEVICE_IOS_RECORDautocapture, stream, shots, or auto fallback
SHOT_MAX_HEIGHT1000Height of the small screenshot copy; 0 = full size only
DEVICE_QUIET_REQUIREDunset1 makes preflight and record start fail if notifications are not silenced
SCRATCH_ROOTsystem temp dirWhere shots, video and logs go
DEVICE_TESTING_ADDONSempty:-separated add-on modules

More keys (log buffer, symbol files, prefs files, input server, WDA) are in config.example.env.

Platform requirements
  • python3 3.9+, standard library only.

  • Android: adb on PATH, USB debugging on, host authorized.

  • iOS: Xcode (xcrun devicectl), pymobiledevice3, iPhone paired over USB with Developer Mode on and "Trust This Computer" accepted.

  • iOS record: ffmpeg. Full rate needs Camera access for the terminal's app, else about 5 fps screenshots.

  • Optional: Pillow (small copies, contact sheets), idb (simulator harness only).

iOS input
  • iOS 27+: taps go through the host (hid).

  • Older iOS, or when host taps fail: the app needs an in-app input server.

  • It is a loopback HTTP endpoint, started only when an environment variable is set, kept out of release builds.

  • Connect with device launch --input-server, then device forward.

  • Protocol: references/input-server.md.

Optional Claude Code extras
  • Runner subagent: copy or symlink agents/device-runner.md into ~/.claude/agents/.

  • Tap-nudge hook: a PostToolUse hook on Bash that only prints a hint after 3 single inputs in a row. It never blocks.

  • Tune it with DEVICE_TAP_NUDGE_EVERY and DEVICE_TAP_NUDGE_CLI. Setup is in INSTALL.md.

Safety and uninstall
  • The runner never installs a build it was not told to, clears app data or posts anywhere.

  • Scratch output stays under SCRATCH_ROOT; nothing is written elsewhere.

  • Stop the app after a pass (a running game heats the phone).

  • Uninstall: delete the folder and ~/.config/device-testing/.

Files

Part of agnostic-skills · MIT