[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80511":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":34,"discoverSource":35},80511,"handsets","elliotgao2\u002Fhandsets","elliotgao2","A high-performance Android automation CLI, built for agents and humans","https:\u002F\u002Fhandsets.dev",null,"Rust",93,8,80,1,0,2,3,11,6,2.86,"MIT License",false,"main",true,[27,28,29,30],"ai-agents","android","cli","rust","2026-06-12 02:04:03","\u003Cp align=\"center\">\n  \u003Cimg src=\"logo.svg\" alt=\"Handsets\" width=\"540\">\n  \u003Cbr>\u003Cbr>\n  \u003Cem>Drive Android from the shell, in milliseconds. One jar; no app, no root.\u003C\u002Fem>\n  \u003Cbr>\u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Felliotgao2\u002Fhandsets\u002Freleases\u002Flatest\">\u003Cimg alt=\"release\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Felliotgao2\u002Fhandsets?color=blue\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fhandsets\u002F\">\u003Cimg alt=\"pypi\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fhandsets?color=blue\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg alt=\"license\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green\">\u003C\u002Fa>\n\u003C\u002Fp>\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.\nRaw `screenshot` defaults to 768px-long-edge JPEG, the fast agent path;\n`hs see out.jpg` saves a native-resolution export unless you pass `--size 768`.\nUse WebP for compact lossy exports and PNG only for debug\u002Flossless files.\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\u002FJSON | WebDriver |\n| Driven from | **any language via subprocess** | shell \u002F subprocess | Python only | multi-lang via WebDriver |\n\nReproduce with `hs bench -n 50`; methodology in [docs\u002Fbenchmark.md](docs\u002Fbenchmark.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## `hs tui` — drive any Android app from your keyboard\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"tui.gif\" alt=\"hs tui — keyboard-driven Android inspector\" width=\"720\">\n\u003C\u002Fp>\n\nA live, video-stream terminal UI of the device's interactive elements. A\nbackground watcher polls the accessibility tree at ~10 fps, so the list on\nscreen *is* the live state of the device — no manual refresh, no waiting for\nidle, no race between tap and re-dump.\n\n- **One screen for the whole flow.** `↑↓` \u002F `jk` to move, **Enter** to tap a\n  Button or open an input modal for an EditText, **PgDn\u002FPgUp** or **Shift+J\u002FK**\n  to swipe, **←** \u002F **Esc** for BACK, **q** to quit. No more copy-paste between\n  `hs ui` and `hs tap \"…\"`.\n- **What you see is what you'd script.** Rows render the same verb-led table\n  as `hs ui -i` — `fill EditText \"Email\" #email`, `tap Button \"Continue\"\n  #continue` — so once the flow works in `tui`, you already know the\n  selectors for `hs run` automation.\n- **Fast.** Actions are fire-and-forget over a dedicated socket; the watcher\n  picks up the new screen on its next 100ms tick. Mash keys without waiting.\n- **Works on animated pages.** No `wait_for_idle` blocking — even constantly\n  animating screens render smoothly at 10–20 fps.\n\nOpen it with `hs tui` after `hs use`. Built as a sibling crate\n(`handsets-tui`, [ratatui](https:\u002F\u002Fratatui.rs) + crossterm) so the core `hs`\nbinary stays zero-dep.\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\u002Fcookbook.md](docs\u002Fcookbook.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\u002FAm\u002FWm\u002FSettings)\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>:\u003Cdetail>              failure\n```\n\nFull protocol: [docs\u002Fwire.md](docs\u002Fwire.md). Reflection details and sharp edges: [docs\u002Farchitecture.md](docs\u002Farchitecture.md), [docs\u002Fsharp-edges.md](docs\u002Fsharp-edges.md).\n\n## Install\n\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Felliotgao2\u002Fhandsets\u002Fmain\u002Finstall.sh | bash\n```\n\nNeeds `adb` on `$PATH`. macOS and Linux. Pin a version with `HANDSETS_VERSION=v0.1.26`.\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\u002Fcookbook.md), long-form posts on the [Blog](https:\u002F\u002Felliotgao2.github.io\u002Fhandsets\u002Fblog\u002F).\n\nPre-1.0. CLI surface stable since v0.1.0. Wire protocol versioned via the `info` verb. MIT — see [LICENSE](LICENSE).\n","Handsets 是一个高性能的Android自动化命令行工具，专为代理和人类用户设计。它允许用户通过简单的命令行操作来控制Android设备，如启动守护进程、查找UI元素并执行点击等操作。该项目采用Rust语言编写，确保了低延迟（单次调用延迟2-7毫秒）和高效率。Handsets的核心特点包括：仅需一个轻量级jar包即可在设备上运行，支持基于文本查找而非坐标定位UI元素，以及能够通过任何语言的子进程驱动。此外，它还提供了一个实时视频流终端界面`hs tui`，使得整个流程可以在单一屏幕上完成，极大提高了用户体验。该工具非常适合需要快速响应和频繁交互的场景，比如移动应用测试、自动化任务执行等。","2026-06-11 04:01:01","CREATED_QUERY"]