简体中文 · English
An AI agent on your phone: clean chat, ready to build
A third-party Android client built on the official Pi SDK (@earendil-works/pi-coding-agent). Not affiliated with the official Pi team.


16-second demo: streaming layout, offline math, and message queueing (MP4 video).
Just Chat · Make It Build · Under the Hood
- For everyday chat: Use it as a clean, vendor-neutral chat app with your own model accounts or keys and local history on your phone.
- When you need action: Inside the same conversation, open a project folder on your device so the agent can read files, edit code with diffs, and run tests or terminal commands.
- For tinkerers and developers: Install Pi extensions, connect external tool servers, switch container runtimes, or build straight from source.
You get offline rendering for Markdown, tables, math formulas, diagrams, and syntax-highlighted code, with steady streaming that avoids scroll jitter. Long replies open into a dedicated copy view for free text selection or block-by-block copying.

Sign in directly with OAuth subscription accounts, add your own API keys, or point to a self-hosted compatible endpoint. Adjust thinking depth and context usage right from the composer, with conversations stored locally as files that support branching and export.

A ready-to-use local Linux environment with standard developer tools is bundled inside the app. Once you pick a workspace folder, the agent can inspect files, show word-level diffs, and run commands while you jump into the built-in multi-tab terminal anytime.

Because the app runs the official Pi SDK directly, desktop extensions, skills, prompt templates, and ~/.pi directory layouts carry over to mobile. You can connect MCP (Model Context Protocol, a standard for exposing external tools and data sources) servers and use Code Mode to batch multiple tool calls in a single turn.

All three phone capability groups (System Interaction, Screen Automation, and Device Shell) are disabled by default and consume zero context tokens while off. When enabled, irreversible actions such as sending replies trigger a native three-choice confirmation dialog before execution.

Many desktop Pi extensions draw text-based panels, progress bars, or status widgets inside a terminal. Pi for Android maps them onto your phone through a Virtual TUI (a rendering layer that turns terminal cell grids into touch-friendly native views) with touch scrolling, clickable links, and extracted quick actions.

| Aspect | Cloud Chat Wrappers | Termux + CLI pi | Pi for Android |
|---|---|---|---|
| Reading & formatting | Native UI; math/diagram support varies by vendor | Plain terminal text on a narrow screen | Native UI with offline math, diagrams, and code |
| Local files & shell | Typically file uploads only; no local runtime | Full local environment; manual setup required | Bundled Linux runtime and terminal out of the box |
| Models & history | Accounts and chat logs usually cloud-hosted | Local storage and bring-your-own models | Local storage; OAuth, API keys, and custom endpoints |
| Desktop Pi TUI extensions | Not compatible with Pi extensions | Native terminal display; awkward with soft keyboards | Virtual TUI projection with touch scroll and action chips |
| Optional device automation | Limited to standard OS share intents | Requires manual Termux API or ADB scripts | Built-in opt-in bridge, all off by default, confirm prompts |
Requirements: Android 8.0 (API 26) or newer on an arm64-v8a device. No Root and no Termux required.
- Download
pi-android-*-sideload28-arm64.apkfrom GitHub Releases and install it. - Open the app and wait briefly while the first launch unpacks the bundled runtime.
- Open Settings → Models & Providers, sign in via OAuth or enter an API key, and start chatting (pick a project folder from the top bar menu whenever you want it to edit code).
Choosing a build: pick sideload28 for everyday use (it pins targetSdk 28 so Android 10+ allows executing the unpacked runtime reliably); modern36 is provided for testing targetSdk 36 behavior. Future updates install in place via Settings → App Updates without wiping your conversations or tools.
1. Do I need Root or Linux knowledge?
No. If you only want to chat, you never touch a terminal or Linux commands. Picking a project folder is only needed when you ask the agent to read or modify files.
2. Can I use it as a regular chat app and send images?
Yes. It opens straight into a clean chat view. You can attach images from your gallery or file picker (automatically resized to respect your model's image limits), while non-image files are copied into the active workspace for the agent to inspect.
3. Does it support web search?
The app does not bundle a proprietary search proxy. For live web lookup, you can use search capabilities provided by your model vendor, run CLI tools in the local environment, or connect a web-search MCP server or community extension.
4. Where are chats stored, and are they uploaded anywhere?
Sessions (JSONL files), settings, and credentials stay inside the app's local storage (~/.pi/agent/). There is no developer-hosted backend server; prompts go directly from your phone to the model providers or MCP servers you configure.
5. How much storage space does it need?
The APK is around 149 MB (bundling Ubuntu 24.04 ARM64 base, Node.js, Git, ripgrep, fd, and offline math/diagram engines). After first-launch extraction, plan for roughly 1 GB of free space to leave room for unpacked tools and package caches.
6. How do I upgrade without losing data?
Use Settings → App Updates inside the app or install a newer APK of the same build variant (such as sideload28) over the existing installation. Releases share a fixed sideload signing key and only replace changed runtime bundles by checksum, preserving your sessions, settings, workspaces, and installed container packages.
7. Is it compatible with desktop Pi configurations?
Yes. Because it runs the official @earendil-works/pi-coding-agent SDK directly, ~/.pi/agent/, project .pi/ folders, theme JSON files, JSONL sessions, skills, and extensions follow desktop conventions.
8. How should I choose between PRoot, Proroot, and TAWCROOT?
Stick with the default PRoot for broad device compatibility. Proroot (closed-source binary) and TAWCROOT (open-source single-process seccomp backend built from source in CI) are experimental options aimed at lower syscall overhead; switching runs an automated compatibility probe and falls back to PRoot if a check fails. See docs/runtime-engines.md.
9. Are the device capabilities safe?
All three capability groups are turned off by default. Disabled groups are never injected into model prompts and do not request sensitive system permissions. Once turned on, irreversible actions require explicit confirmation via a three-choice native dialog, and you can switch any group off at any time.
10. What is the relationship to the official Pi project?
Pi for Android is an independent, community-maintained third-party Android client built on top of the published @earendil-works/pi-coding-agent SDK. It is not produced or endorsed by the official Pi team.
11. Why is it not on Google Play?
The recommended sideload28 build pins targetSdk 28 so Android 10+ allows executing unpacked Linux binaries from app storage, which does not meet Google Play's target API requirement, and uses a public fixed sideload key in the repository for seamless in-place updates. The modern36 variant tracks targetSdk 36 compatibility work.
- Data flow: The app ships no analytics or ad SDKs. Network traffic goes strictly to the model endpoints and MCP servers you configure, plus manual update checks against GitHub Releases.
- Core permissions:
INTERNETconnects to your configured providers; foreground service and wake lock keep long turns running while the screen is off;MANAGE_EXTERNAL_STORAGE(all files access) is requested only when you pick an external device folder as a workspace because containers bind-mount real filesystem paths;usesCleartextTrafficallows cleartext HTTP process-wide so Markdownhttp://images can load. - Optional device capability risks: System Interaction (notifications, clipboard, location, torch, app launch), Screen Automation (Android Accessibility Service), and Device Shell (optional ADB-level elevation via Shizuku) are all disabled by default. Turning on Accessibility or Shizuku allows the agent to read screen contents or execute shell commands on your phone; prompt injection or model mistakes could cause unintended actions, so enable only what you need and review every confirmation dialog carefully.
Architecture, protocol docs, CI guards, building from source, and asset regeneration
flowchart TB
A["Android Native UI (Kotlin · Jetpack Compose)"]
B["Offline Render Pipeline (GFM · MathJax 4 · Mermaid 12) · Virtual TUI · PTY Terminal"]
C["Typed JSONL Frame Protocol (seq · epoch · backpressure)"]
D["Node.js SDK Host (host.bundle.mjs + builtin:pi-android-bridge)"]
E["Official @earendil-works/pi-coding-agent 1.6.1 SDK"]
F["Container Runtimes (PRoot · Proroot · TAWCROOT) + Ubuntu 24.04 ARM64 / Node 24"]
A --> B --> C <--> D --> E
D --> F
- Technical documentation: Architecture · Wire Protocol · SDK Upgrading · Runtime Engines · AGENTS.md
- Automated CI and cold-start guards: Every push runs 6 GitHub Actions jobs (
tawcrootNDK build,SDK Hostcontract and runtime suite including cold-startimport-audit,Static safety guardsincluding 12 startup guards and i18n checks,JVM unit tests,APK modern36, andAPK sideload28).
git clone https://github.com/heikeyangle-code/pi-mobile-agent.git
cd pi-mobile-agent
# 1. Run SDK host checks, startup guards, and unit tests
node tools/sdk-host/contract.mjs
node tools/sdk-host/test.mjs
node tools/check-startup-perf.mjs
./gradlew :protocol:test :app:testDebugUnitTest
# 2. Fetch runtime bundles and assemble the Release APK
node tools/fetch-runtime.mjs
./gradlew :app:assembleReleaseAll static galleries (WebP), animated demos (GIF), and videos (MP4) in this README are generated reproducibly from code using the repository's own bundled fonts and offline MathJax 4 / Mermaid 12 engines:
# Requires Python 3, Playwright, Chromium, ffmpeg, and cwebp
python3 tools/readme-assets/render.pyGenerator sources live in tools/readme-assets/ and write to docs/assets/.
- Report bugs or request features in GitHub Issues.
- Follow releases and changelogs on GitHub Releases.
Issues and pull requests are welcome. Before submitting changes, please read AGENTS.md for cold-start performance guards, rendering rules, and bilingual requirements. If you edit anything under app/src/main/assets/guest/sdk-host/, run node tools/sdk-host/build-bundle.mjs and verify that static guards and tests pass.
Released under the MIT License. Third-party components bundled inside the APK are distributed under their respective upstream licenses; see Settings → Open-Source Licenses inside the app or app/src/main/assets/licenses/ for the full manifest and license texts.
Acknowledgements:
- @earendil-works/pi-coding-agent: Core agent session, tools, extensions, and MCP runtime.
- Termux:
terminal-emulator,terminal-view,proot, andlibandroid-shmem. - proroot: Optional experimental container runtime (proprietary component redistributed unmodified; see
proroot-license.txt). - wmww/tawc: Experimental single-process
seccompcontainer backendtawcroot(MIT). - Offline rendering engines: Mermaid and MathJax for vector diagrams and math equations.
- Android rendering and system libraries: JetBrains Markdown, AndroidSVG, jsoup, SnakeYAML, and Shizuku API.
- Bundled fonts: IBM Plex Sans SC, JetBrains Mono, Geist Mono, Source Han Serif CN, and LXGW WenKai.