Termux (Android)
Pi can run on Android devices using Termux, a terminal emulator that provides a Linux environment without rooting.
Prerequisites
Install both Termux and Termux:API from GitHub Releases or F-Droid.
Do not install Termux from Google Play. The Google Play version is outdated and incompatible with Termux:API.
Installation
Clipboard Support
Pi clipboard integration on Termux uses termux-clipboard-get and termux-clipboard-set from the Termux:API package.
- Text clipboard works normally
- Image clipboard is not supported on Termux
Ensure the Termux:API app is installed alongside the Termux terminal app for clipboard commands to function.
Example AGENTS.md for Termux
Add this to your project's AGENTS.md to help Pi understand the Termux environment:
Limitations
- No image clipboard: Termux:API only supports text clipboard operations. Image paste and screenshot features are unavailable.
- No native binaries: Pre-compiled x86/x64 Linux binaries do not work. Packages must be installed through
pkgor compiled from source for the device architecture. - Storage access: Android scoped storage restrictions apply. Run
termux-setup-storageonce to create~/storage/sharedfor access to device files. - Background execution: Android may kill Termux processes in the background. Use
termux-wake-lockto keep the process alive during long operations.
Troubleshooting
Clipboard not working
- Confirm Termux:API app is installed (separate from the Termux terminal).
- Run
termux-clipboard-getmanually to verify it returns clipboard content. - If you see a permission error, open Android Settings and grant Termux:API the required permissions.
Permission denied errors
Run termux-setup-storage to grant Termux access to shared storage. This creates symlinks under ~/storage/.
Node.js issues
If pkg install nodejs-lts fails, update your package repositories first:
If you encounter architecture-related build errors with native modules, use pkg install build-essential to install compilation tools.