{"id":50095492,"url":"https://github.com/elliotgao2/handsets","last_synced_at":"2026-05-27T07:00:37.986Z","repository":{"id":359298253,"uuid":"1245356640","full_name":"elliotgao2/handsets","owner":"elliotgao2","description":"A high-performance Android automation CLI, built for agents and humans","archived":false,"fork":false,"pushed_at":"2026-05-26T05:23:30.000Z","size":2627,"stargazers_count":72,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T06:34:29.773Z","etag":null,"topics":["ai-agents","android","cli","rust"],"latest_commit_sha":null,"homepage":"https://handsets.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotgao2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-21T06:33:33.000Z","updated_at":"2026-05-26T05:23:24.000Z","dependencies_parsed_at":"2026-05-24T04:01:19.213Z","dependency_job_id":null,"html_url":"https://github.com/elliotgao2/handsets","commit_stats":null,"previous_names":["elliotgao2/handsets"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/elliotgao2/handsets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Fhandsets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Fhandsets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Fhandsets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Fhandsets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotgao2","download_url":"https://codeload.github.com/elliotgao2/handsets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotgao2%2Fhandsets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33554780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","android","cli","rust"],"created_at":"2026-05-23T03:13:30.608Z","updated_at":"2026-05-27T07:00:37.966Z","avatar_url":"https://github.com/elliotgao2.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.svg\" alt=\"Handsets\" width=\"540\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cem\u003eDrive Android from the shell, in milliseconds. One jar; no app, no root.\u003c/em\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003ca href=\"https://github.com/elliotgao2/handsets/releases/latest\"\u003e\u003cimg alt=\"release\" src=\"https://img.shields.io/github/v/release/elliotgao2/handsets?color=blue\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/handsets/\"\u003e\u003cimg alt=\"pypi\" src=\"https://img.shields.io/pypi/v/handsets?color=blue\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg alt=\"license\" src=\"https://img.shields.io/badge/license-MIT-green\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n```bash\n$ hs use                              # connect, start the on-device daemon\ndaemon up on tcp:9008\n\n$ hs ui                               # flat table of tappable nodes\nfill  EditText  \"Email\"     #email     540,540\nfill  EditText  \"Password\"  #password  540,640  [password]\ntap   Button    \"Continue\"  #continue  540,860\n\n$ hs tap  \"Continue\"                  # text-lookup tap\n$ hs wait \"Welcome\"                   # block on success text\n```\n\n`ui → label → tap → wait`. Pipe `hs ui` into a model, take the label, hand it back.\n\n|  | **Handsets** | `adb shell` | uiautomator2 | Appium |\n|---|---|---|---|---|\n| Single-call latency | **2–7 ms** | 40–700 ms | 30–100 ms | 100–500 ms |\n| Find by label, not coords | **yes** | no | yes | yes |\n| On-device install | **1 jar (~few hundred KB)** | none | 2 APKs + `atx-agent` | driver APK + Node server |\n| Wire | TCP, length-prefixed binary | ADB protocol | HTTP/JSON | WebDriver |\n| Driven from | **any language via subprocess** | shell / subprocess | Python only | multi-lang via WebDriver |\n\nReproduce with `hs bench -n 50`; methodology in [docs/benchmark.md](docs/benchmark.md). uiautomator2 and Appium ship things Handsets doesn't — recorders, pytest plugins, HTML reports, iOS support. Handsets is the lean CLI for tap-heavy work where per-call cost matters.\n\n## Selectors\n\nCSS-like, Playwright-inspired:\n\n```bash\nhs tap   'EditText[hint~=Email]'             --visible --unique\nhs fill  'EditText[hint~=Password]'          'hunter2'\nhs tap   'Button:has-text(\"Sign in\")'        --visible --unique --timeout 5s\nhs wait  \"Dashboard\"                         --timeout 15s\n```\n\nVocabulary: `[a=v]` `[a~=sub]` `[a^=pre]` `[a$=suf]` · `:visible :clickable :enabled :focused :checked` · `:has-text(\"x\") :text-is(\"x\")` · `:in(SEL) :below(SEL) :right-of(SEL) :near(SEL, PX)`. Comma is OR. More patterns in [docs/cookbook.md](docs/cookbook.md).\n\n## How it works\n\n```\nhost                                  device (shell UID via app_process)\n─────                                  ─────────────────────────────────\n  hs ─── adb forward ────► tcp:9008 ─► Server.java\n                                         ├─ accessibility dump\n                                         ├─ binder reflection (Pm/Am/Wm/Settings)\n                                         └─ screenshots + state mirror\n```\n\nLength-prefixed binary frames over `adb forward`:\n\n```\nhost → device:   [u32 BE len][ascii: verb [k=v ...]]\ndevice → host:   [u32 BE len][bytes]              ok body\n                 [u32 BE 0]                       end-of-stream\n                 ERR:\u003cCODE\u003e:\u003cdetail\u003e              failure\n```\n\nFull protocol: [docs/wire.md](docs/wire.md). Reflection details and sharp edges: [docs/architecture.md](docs/architecture.md), [docs/sharp-edges.md](docs/sharp-edges.md).\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/elliotgao2/handsets/main/install.sh | bash\n```\n\nNeeds `adb` on `$PATH`. macOS and Linux. Pin a version with `HANDSETS_VERSION=v0.1.17`.\n\nPython bindings: `pip install handsets`.\n\n```python\nfrom handsets import Session\nwith Session() as d:\n    d.tap(\"Continue\")\n    d.wait(text=\"Welcome\", timeout=\"15s\")\n```\n\nFor other languages, drive `hs --json` as a subprocess and parse one JSON line per call.\n\n---\n\nExit codes: `0` ok · `1` failure · `2` NOT_FOUND · `3` TIMEOUT · `4` AMBIGUOUS. Full structured `error.code` in `hs --json` output for the long tail.\n\n`hs --help` is the verb table. Recipes in the [Cookbook](docs/cookbook.md), long-form posts on the [Blog](https://elliotgao2.github.io/handsets/blog/).\n\nPre-1.0. CLI surface stable since v0.1.0. Wire protocol versioned via the `info` verb. MIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotgao2%2Fhandsets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotgao2%2Fhandsets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotgao2%2Fhandsets/lists"}