Pocket Pi: a coding agent inside an iPhone app, built and signed from Linux
Pocket Pi puts the Pi agent loop (pi-agent-core and pi-ai) inside an iPhone app. The agent runs in a hidden web view, while Swift handles every network call and exposes phone tools such as calendar, reminders, contacts, location, web and Shortcuts. It is built and signed from Linux with xtool. What I sell is agent environments on phones, built in this style.
Running an agent on a phone usually means a thin client talking to a server. Pocket Pi runs the agent loop on the phone itself, and the whole app is built without a Mac.
How it's put together
- Brain: a hidden web view runs Pi's agent core and model layer, bundled for the browser. Its tools are thin stubs that call into Swift.
- Hands: a second web view runs scripts and agent-made pages, with user-installed JavaScript libraries served from the same origin.
- Swift owns the network bridge, the native tools, the library installer and storage. Neither web view has direct network access: a content rule blocks http and https, and navigation outside the app's own scheme is denied.
- A library shelf the user manages: the user decides which libraries are installed and which ones the agent may use.
What it has gained so far
| Step | Added |
|---|---|
| 1 (v0) | Pi agent core in WebKit, Swift bridges, phone tools, the library shelf |
| 2 | OpenRouter API-key access and a model picker |
| 3 | Surviving app switches: background time, retry before reply, resume after drops |
| 4 | Python through Pyodide, with a package shelf and run_python |
| 5 (v0.3) | Calendar, reminders, contacts, location, web and Shortcuts |
Facts
| Item | Detail |
|---|---|
| History | 6 commits; three IPA builds (Oct 5–6, 2026) |
| Build | Swift Package Manager through xtool on Linux; no Mac |
| Proven off-device | The agent loop, a custom tool and a provider ran end to end in headless Chromium |
| Status | Early. On-device behaviour is still being checked |
What you can buy
Agent environments on phones, built to your spec: tasks that use real phone capabilities (calendar, contacts, location, Shortcuts), with graders and a sandbox that controls what the agent can reach. Delivered as HUD tasksets or as a repository with a runner.
FAQ
Can you build an iOS app without a Mac?
Yes, for this app. Pocket Pi is compiled with Swift Package Manager through xtool on Linux and packaged as an IPA. Signing uses an Apple ID, and a free one needs renewing every seven days.
Where does the agent run?
On the phone. Pi's agent core runs in a hidden WebKit view inside the app, and Swift carries all model traffic, because the web views have no network access of their own.
Is Pocket Pi available to download?
No. It is a working prototype, not an App Store app. I build environments and agents in this style to order.
License it, or have me build an environment in the same style.