Took a while to figure out but it works. The binary has 7 separate issues on Android
Honestly the easiest way to do it: just copy paste this entire guide into your existing AI agent on termux(may be opencode or Gemini) and tell it to set up your environment. It’ll handle everything automatically.
Guide:
Working setup for running Antigravity CLI (agy) natively on Android Termux without proot-distro, VMs, or Cloud Shell. Fixes 7 compatibility issues: TCMalloc 39-bit VA, faccessat2 syscall, glibc libc.so shim, LD_PRELOAD pollution, DNS resolver, TLS certificates, and shell hash caching. Includes a reusable pattern-based binary patch script (patch_agy_va39.py) that works across versions. Tested on Antigravity CLI 1.0.1 / Android ARM64 (39-bit VA). If you hit the same issue, you can paste this entire document into any AI agent and ask it to set up your environment, it has enough detail to follow without human guidance. · GitHub
Or send it the link directly. Either works.
For the nerds: the main issues were TCMalloc assuming 48-bit VA when Android uses 39-bit, Go’s `faccessat2` syscall getting killed by Android’s seccomp, and a few glibc/DNS/TLS things on top. The patch script is pattern-based so it should survive future updates too.
Drop a upvote and comment if it works for you or if you hit something new.
Easier Alternative (Recommended for Most Users)
@wallentx built an automated release pipeline on top of this work. No manual patching needed anymore.
curl -fsSL https://raw.githubusercontent.com/wallentx/antigravity-cli-termux/dev/install.sh | bash
This installer automatically:
- Downloads the latest pre-patched release
- Sets up the glibc environment
- Verifies both binaries
- Launches agy immediately
A GitHub Actions workflow runs every 6 hours detecting new Antigravity releases, applies all patches automatically, and publishes a ready-to-use binary. So when Antigravity updates, just re-run the same command.
Full repo: GitHub - wallentx/antigravity-cli-termux: Fork producing Termux compatible builds · GitHub
Use the manual method mentioned above only if:
- The installer doesn’t work on your specific device
- You want to understand what’s happening under the hood
- You hit a device-specific issue that needs debugging