{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "phone-harness-phone-harness--script-a-phone-task-in-python",
 "repo": "phone-harness/phone-harness",
 "repo_url": "https://github.com/phone-harness/phone-harness",
 "repo_slug": "phone-harness-phone-harness",
 "title": "Script a phone task in Python",
 "page_title": "How to script a phone task in Python with Phone Harness",
 "summary": "Pipe a short script of helper calls into Phone Harness to open an app, tap and type.",
 "who": "A tester who wants to repeat the same steps in the Notes app.",
 "problem": "Manual tapping through the same flow wastes time.",
 "outcome": "A note typed on the phone and the first screen texts printed.",
 "steps": [
  "Run `phone-harness config set platform ios|android` to pick the default phone",
  "Run `phone-harness <<'PY'` and in the script call open_app(\"Notes\"), tap_text(\"New Note\") and type_text(\"hello from the harness\")",
  "Print the screen text with `print([o[\"text\"] for o in screen()][:10])`",
  "End the heredoc with PY"
 ],
 "agent_prompt": "Using phone-harness, write the heredoc script that opens Notes, taps New Note, types a line and prints the first 10 screen texts.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "The README notes OCR sees text, not icons, and there is no multi-touch.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "An iPhone with iPhone Mirroring on macOS 15 or newer, or an Android with adb and USB debugging",
  "A coding agent such as Claude Code or Codex",
  "uv with Python 3.12"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/phone-harness-phone-harness/script-a-phone-task-in-python/",
 "md": "https://dedupedai.com/use-cases/phone-harness-phone-harness/script-a-phone-task-in-python/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/phone-harness-phone-harness--script-a-phone-task-in-python.json",
 "api_version": "v1"
}
