Singapore-based practical guides, tutorials and experiments in AI, computing, modelling, simulation, optimisation and quantum computing, with research notes and hands-on workflows.

, , ,

Running Google’s Antigravity CLI on Termux: The Complete Workaround for Broken ARM64 Builds

A tested proot-distro workaround for running Google’s Antigravity CLI on Android Termux, connecting WordPress.com MCP, and why Codex can auto-open browsers while PRoot needs an xdg-open bridge.

·

Written by

DEV TOOLS 2026
Running Google’s Antigravity CLI in Termux: the complete workaround for Bionic TLS alignment errors, seamless wrappers, WordPress MCP publishing, and why Codex can open browsers while PRoot needs an xdg-open bridge.

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 and configuring Android so OAuth browser windows pop up automatically just like native Termux tools.


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:

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  ·  Power User Insight: Native Termux Wrapper Shortcut

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' > /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.

With this bridge in place inside Ubuntu, any MCP server, Python script, or Node tool running in Antigravity will pop open Chrome or your default Android browser automatically, exactly like native Termux tools!


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.

How was this very article published?

This post was drafted in Termux, styled according to our 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.

Conclusion: 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 and xdg-open bridged to termux-open-url, 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.

Dev Tools 2026  ·  Tested on Android 14 / Termux  ·  Ubuntu 24.04 LTS ARM64 PRoot  ·  Published via WordPress.com MCP

✦ This guide was prepared and published with the assistance of Antigravity by Google DeepMind. Commands, installation paths, and TLS segment workarounds were verified in the documented Termux environment. ✦

Comments

Leave a comment

More posts