Most "phone automation" advice assumes one of two things: you have a PC with adb plugged into the phone, or you pay for a cloud device farm. I had neither. I had a phone in a drawer.
Pocket Worker is what came out of that. It is an open-source (AGPL-3.0) two-device setup:
- a spare Android phone (Android 10+, just Wi-Fi) runs an APK that uses the Accessibility service to read the current screen and tap or type in native apps,
- a small Cloudflare Worker relays commands between that phone and whatever you are holding,
- you drive it from iOS Safari, a home-screen PWA, an Android browser, or a desktop browser with a six-digit pairing code — or hand a private link to an AI agent and let it work the phone.
No USB cable, no adb, no root, no third-party cloud keeping your screen. The relay runs in your own Cloudflare account, on the free Workers tier.
- Repo: https://github.com/Change03/pocket-worker
- Release (v0.1.0-beta.22): https://github.com/Change03/pocket-worker/releases/tag/v0.1.0-beta.22
Why it has to be a real phone
Accessibility automation is not glamorous, but it is the only way to drive apps that have no API: a blog app, a delivery app, a POS app for a small shop, a game you want to click through. Browser automation tools stop at the browser boundary. An emulator works until an app checks for it, or until you need real notifications, a real keyboard IME, or a real battery story.
A phone that already exists is free, already has Play Services, already knows your Wi-Fi, and — this matters more than it sounds — is physically disposable. If a job hangs, you can pick it up and unplug it.
The cost is that you have to respect Android's rules: the Accessibility service must be enabled by the owner, and on Android 13+ apps installed from outside a store hit the "restricted settings" gray switch. The README walks that path screen by screen (Play Protect verdicts, Samsung Auto Blocker, the Allow restricted settings menu), because that is where most people give up.
Architecture
Browser / PWA ──┐ External agent ─┼──► Cloudflare Worker ──► Owner-scoped SQLite Durable Object Custom GPT ─────┘ │ hibernating WebSocket │ Spare Android · AccessibilityService │ Native apps and editors │ (optional) OpenAI / Gemini calls Three decisions shaped the design.
1. The relay is a Durable Object per owner, and it hibernates. WebSockets are the only sane transport for "phone gets a command, phone answers with a new screen", but an always-on Worker with an open socket is not free. Cloudflare's hibernating WebSocket support lets the Durable Object drop out of memory while the connection stays alive, and the client keepalives get answered without waking it. For a device that is idle 23 hours a day, that is the difference between "free tier" and "a bill".
2. State lives per owner, not per phone. A Durable Object instance is scoped to one owner's devices, jobs, and pairing state. That keeps the multi-tenant question small: a token can only ever see its own owner's devices, and revoking a phone link in Manage connections takes effect immediately.
3. The relay stores summaries, not screens. Raw screenshots and full UI trees never go into SQLite. What is kept is bounded job summaries and counters, and the relay reports estimated usage through /status. Screenshots are forwarded on request and dropped. This is a deliberate constraint: a phone's screen is the most sensitive artifact in the system, and I did not want a copy of it sitting in storage I might later misconfigure.
Jobs run for up to 20 steps or 15 minutes; approvals are bound to the observed action and expire after 180 seconds; terminal jobs are removed after 24 hours.
Setup, honestly
- Deploy the relay. A "Deploy to Cloudflare Workers" button in the README creates the Worker from
relay-server/in your account. You set aSETUP_CODE, open the generatedworkers.devaddress, pick an admin password, and get a registration QR. - Install the APK. Download from GitHub Releases on the spare phone. There are two files with the same signature: the standard APK follows the phone language, and
-en.apkopens in English even on a Korean phone.SHA256SUMS.txtsits beside them. - Pair. Scan the admin QR on the phone, then either open the spare phone's Connect to the web controller and type its six digits into your browser (codes last five minutes), or copy the private connection link from the dashboard and hand it to an agent.
The six-digit flow pairs in both directions deliberately: a QR shown in your browser registers a phone, a code shown on the phone signs a browser into that phone's controls. Pairing a wrong phone is a mistake you only make once, so the browser asks you to confirm a matching phrase on the phone before it commits.
iPhone users: open the relay in Safari and Share → Add to Home Screen. It behaves like an app afterward.
The end-to-end test
The test I cared about was not "can it tap a button". It was "can it finish a task the app's own user flow would accept".
So I had it open a native Android blog app, create a post, type a title, type a body, and publish. It did, end to end.
Android 13+ has one sharp edge here: some editors give the title and the body the same keyboard connection, so typing the body can land in the title field, or nowhere. The app handles that with a "choose the body position" flow — you look at a picture of the current screen, click the first line of the body, and the phone verifies which field actually receives the keyboard before it types. If it can't verify, it stops and shows the current screen instead of sending the text twice.
That "stop and show me" behavior is the general rule for anything ambiguous: a temporary disconnect keeps the same session open until its deadline, and if an input was in flight when the connection dropped, you are told to check its result before sending another action.
Where it stops on purpose
This is the part I want to be boringly explicit about, because an agent with Accessibility access to a phone is a loaded gun pointed at your accounts.
- The session stops before a protected transaction or account authorization. Publishing an ordinary post needs no extra approval; paying, signing in, or authorizing accounts does.
- Model-driven jobs (on-device OpenAI/Gemini, or an external agent) request approval for the observed action, and the approval expires in three minutes. It is not a blanket yes for the whole session.
- Any phone link can be revoked immediately from Manage connections.
- Live video for the owner is opt-in per phone, behind an Android capture prompt.
- The README's own instruction is to use it on devices and accounts you control, and to follow each app's terms. If an app forbids automated access, Pocket Worker does not make that allowed.
What it is not
- Not a consumer product. It is
0.1.0-beta.22, a pre-release with a fast changelog. Expect rough edges. - Not a cloud phone. It needs an actual phone, powered, on Wi-Fi, ideally on a charger. An 80% charge limit is the politely recommended setup for a 24-hour worker.
- Not magic on setup. Play Protect can flag sideloaded apps in some markets, Samsung's Auto Blocker needs a temporary opt-out, and manufacturer power management will kill a worker you did not configure.
- Not an API replacement. It drives the UI a person would use, so it inherits every UI change the app ships.
What I want from you
The interesting open questions are ones I cannot answer alone:
- If you run it on a phone you actually leave at home, what breaks first: battery, thermals, or an OEM's background killer?
- Which apps would you rather drive from a PWA than install on your main phone?
- Is the Durable Object hibernation approach worth copying for other "idle device behind a cheap relay" projects? I think it is the most reusable idea in the repo, and it is a small amount of Worker code.
Issues and PRs are open. If you hit a Play Protect verdict or a gray Accessibility switch, the exact wording plus phone model and Android version is the most useful thing you can file.
Repo: https://github.com/Change03/pocket-worker · License: AGPL-3.0-only · Third-party notices (WebRTC SDK, Gradle wrapper) are in NOTICE.

