Originally published on malcolmlow.com.
Google's Antigravity CLI (agy) provides powerful agentic pair programming and terminal workflows. However, running the official ARM64 binary directly inside Android Termux fails immediately because Android's Bionic libc rejects misaligned Thread-Local Storage (TLS) segments generated by modern GNU/Linux toolchains.
By hosting the CLI inside an isolated glibc userspace via PRoot Distro, you can run Antigravity flawlessly on Android. Below is the complete step-by-step setup—from bypassing the TLS bug and creating a 1-click Termux wrapper, to connecting the official WordPress.com MCP server, eliminating confirmation prompts with native read skills, and configuring Android so OAuth browser windows pop up automatically.
1 · Install PRoot Distro in Termux
Termux provides proot-distro to manage chroot-like Linux root filesystems without requiring device root privileges. Install it via pkg:
pkg update && pkg install -y proot-distro
2 · Install and Enter Ubuntu Chroot
Deploy a minimal Ubuntu environment. This downloads the official ARM64 root filesystem:
proot-distro install ubuntu
Once the installation finishes, log into the Ubuntu rootfs:
proot-distro login ubuntu
3 · Install Dependencies & Antigravity CLI
Minimal container images do not ship with SSL certificates or download utilities. Update the package lists and install curl and ca-certificates before running the installer:
apt update && apt install -y curl ca-certificates
Then run Google's official Antigravity CLI installation script:
curl -fsSL https://antigravity.google/cli/install.sh | bash
The installer detects the Linux ARM64 kernel architecture and writes the binary to /root/.local/bin/agy.
4 · Add to PATH and Verify
Ensure the binary is discoverable in your interactive shell:
echo 'export PATH="/root/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
Verify that the binary executes cleanly under glibc:
agy --version
Type exit when finished to return to the native Termux shell.
5 · Native Termux Wrapper Shortcut & Browser Bridge
Opening the Ubuntu chroot manually every time you want to execute an agent command is tedious. You can create a transparent wrapper script directly in Termux's native binary path ($PREFIX/bin/agy):
cat << 'EOF' > $PREFIX/bin/agy
#!/data/data/com.termux/files/usr/bin/bash
exec proot-distro login ubuntu -- agy "$@"
EOF
chmod +x $PREFIX/bin/agy
Next, configure the Android browser bridge inside Ubuntu so OAuth links and web preview commands pop open automatically:
cat << 'EOF' > /usr/local/bin/xdg-open
#!/bin/sh
exec /data/data/com.termux/files/usr/bin/termux-open-url "$@"
EOF
chmod +x /usr/local/bin/xdg-open
Test the bridge immediately:
xdg-open "https://malcolmlow.com/"
Your default Android mobile browser (such as Chrome) will pop open into the foreground instantly.
6 · Eliminating Prompt Fatigue: The Native Read Skill & Sandboxed Python
One of the biggest practical hurdles when running an autonomous AI pair programmer inside Android Termux is confirmation prompt fatigue. In a mobile environment, having the agent pause every few seconds to ask for manual CLI approval completely breaks the autonomous flow.
Three key configurations and architectural practices are absolute lifesavers for achieving a completely hands-off, prompt-free workflow:
1. The Native Read Skill (Life Saver for File Inspection)
Instead of executing terminal commands like cat, head, grep, or writing temporary Python scripts to inspect files—which trigger security confirmation prompts whenever commands attempt to run outside the sandbox—rely strictly on Antigravity's built-in native Read skill (view_file).
The native read tool executes directly in-process without spawning subshells, making it 100% silent and immune to permission prompts. It reads source code, JSON configs, and conversation transcripts instantaneously using slice notation and byte offsets.
2. Standard Sandboxed Python Execution
Avoid inline unsandboxed commands such as python3 -c "..." with sandbox bypass flags (BypassSandbox: true). In Android's Linux environment, running unsandboxed subprocesses repeatedly triggers confirmation dialogs and can fail under restricted system permissions (such as fork/exec: operation not permitted).
Instructing the agent to execute all Python code strictly inside the standard sandbox (and structuring logic into script files) allows it to run computations, data transformations, and tests completely autonomously without stopping for manual approvals.
3. Setting Permission to "Proceed in Sandbox" in Settings
To ensure commands run seamlessly without manual prompts, enable the terminal sandbox and set the agent's tool execution policy to Proceed in Sandbox.
Option A: Via CLI Configuration File (~/.gemini/antigravity-cli/settings.json)
Add or update the following configuration in your Antigravity settings file (~/.gemini/antigravity-cli/settings.json):
{
"enableTerminalSandbox": true,
"toolPermission": "proceed-in-sandbox",
"allowNonWorkspaceAccess": true,
"trustedWorkspaces": [
"/root"
]
}
-
"enableTerminalSandbox": true: Activates the secure sandbox execution environment for agent commands. -
"toolPermission": "proceed-in-sandbox": Instructs Antigravity to always proceed automatically with commands running inside the sandbox without asking for manual confirmation. You will only be prompted if a command explicitly requests to bypass the sandbox. -
"trustedWorkspaces": Defines your working directories as trusted workspaces, preventing non-workspace path access prompts.
Option B: In Antigravity Settings UI
If you are using Antigravity IDE or the desktop UI:
Navigate to Settings (gear icon in sidebar) → Agent Settings & Permissions → set Tool Execution Policy to Proceed in Sandbox (or proceed-in-sandbox), and ensure Terminal Sandbox is toggled On.
💡 Pro Workflow Tip: Combine the native file reader, sandboxed Python,
"toolPermission": "proceed-in-sandbox", and native MCP servers (such as the official WordPress.com MCP server withuser_confirmed: true). This configuration turns Antigravity into a fully autonomous mobile workstation that inspects, codes, and publishes live to the web completely silently.
Technical Insights & FAQ
Why does the binary fail on native Termux?
Android's dynamic linker (Bionic) strictly validates Thread-Local Storage (TLS) alignment and ELF segment offsets. Binaries linked against GNU libc with modern toolchains frequently specify alignment boundaries that Bionic's dynamic linker rejects on startup.
Why did Codex work without PRoot while Antigravity needed it?
Codex's Termux package (@mmmbuto/codex-cli-termux) was specially compiled and packaged to link against Termux's Bionic libc. Antigravity's official distribution is compiled against GNU glibc for standard Linux distributions, making the PRoot environment necessary.
Why does Antigravity repeatedly prompt for confirmation in Termux, and how do I fix it?
Confirmation prompts appear when commands request sandbox bypass (e.g. BypassSandbox: true), use inline python3 -c executions, or run external bash commands to read files. You can silence these prompts completely by:
- Enabling
"enableTerminalSandbox": trueand setting"toolPermission": "proceed-in-sandbox"in~/.gemini/antigravity-cli/settings.json(or in Settings → Agent Settings & Permissions → Tool Execution Policy); - Instructing the agent to execute all Python code strictly inside the sandbox; and
- Using the native in-process file reading skill (
view_file) instead of terminal read commands. Native reading requires zero subprocess permissions and runs 100% silently.
How was this article published?
This post was drafted in Termux, styled according to publication guidelines, authenticated against the official WordPress.com MCP server, and published live directly via the WordPress REST API without opening a web admin dashboard.
What is the performance overhead of PRoot?
PRoot uses ptrace to intercept and emulate Linux system calls in userspace without requiring root. While I/O-heavy compiles can be 20–30% slower, CLI network calls, inference streaming, and code edits perform at near-native speeds on modern multi-core ARM chips.
How do I prevent Android from killing background tasks?
Android 12+ introduced the Phantom Process Killer, which aggressively terminates child processes that consume significant CPU or spawn background workers. Run termux-wake-lock in Termux before running extended agent sessions to prevent Android from putting Termux into deep sleep.
Summary
Combining proot-distro with Antigravity CLI and the WordPress.com MCP server turns an Android device into a self-contained mobile publishing workstation. With native path wrappers, xdg-open bridged to termux-open-url, and prompt-free native read tools, the development and publishing workflow is completely frictionless and matches native Termux tooling.
Storage Tip: A minimal Ubuntu rootfs takes ~80MB compressed and ~250MB extracted. Keep your Termux internal storage above 1.5GB to account for pip/npm toolchains and model cache files.
Tested on Android 14 / Termux · Ubuntu 24.04 LTS ARM64 PRoot · Published via WordPress.com MCP
Top comments (0)