{"slug": "working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without", "title": "Working setup for running Antigravity CLI (agy) natively on Android Termux without proot-distro, VMs, or Cloud Shell.", "summary": "This article describes a method for running the official Linux ARM64 Antigravity CLI (agy) natively on Android Termux without using virtual machines, proot-distro, or cloud shells. The setup resolves seven specific compatibility issues, including TCMalloc's 39-bit virtual address space assumption, blocked syscalls, and glibc environment conflicts, using a reusable binary patch script and a wrapper. The solution is designed to be repeatable for future Antigravity releases by scanning instruction patterns rather than relying on fixed offsets.", "body_md": "\nThis document describes the working setup for running the native Antigravity CLI (`agy`) on Android Termux.\n\nThe main goal is to run the official Linux ARM64 Antigravity binary directly from Termux without Cloud Shell, without a full VM, and without replacing Android. The setup uses a small binary patch plus a wrapper that adapts the Linux/glibc binary to Termux's Android environment.\n\nThe method is designed to be repeatable for future Antigravity releases. The patch script scans instruction patterns instead of relying on fixed offsets. If Antigravity changes its allocator code generation in the future, the script will print warning counts instead of silently claiming success.\n\n## What This Fixes\n\nAntigravity's Linux ARM64 binary can fail on Termux for multiple independent reasons.\n\nThe working setup fixes these problems:\n\n1. TCMalloc assumes a 48-bit ARM64 userspace virtual address space.\n2. Many Android/Termux devices expose only a 39-bit userspace virtual address layout.\n3. Android seccomp can block Go's `faccessat2` syscall and kill the process with `SIGSYS`.\n4. Termux's `LD_PRELOAD` can inject a Bionic preload library into the glibc binary.\n5. The glibc environment may try to load `libc.so`, but Termux glibc's `libc.so` is a linker script, not an ELF shared object.\n6. Go's DNS resolver inside the glibc-loaded binary may not find the correct Android/Termux resolver config.\n7. TLS verification can fail unless the Termux CA bundle is exposed through `SSL_CERT_FILE`.\n8. Shell command hashing can keep pointing at an old `agy`, so the shortcut clears the shell hash before launching.\n\n## Expected Final Layout\n\nAfter setup, the important files are:\n\n```text\n~/.local/bin/agy              # original official Antigravity binary, left unchanged\n~/.local/bin/agy.va39         # patched binary generated by the script\n~/.local/bin/agy-va39         # wrapper used to launch the patched binary\n~/.local/lib/agy-glibc/libc.so\n~/.local/lib/agy-glibc/libc.so.6\n~/patch_agy_va39.py           # reusable patch script\n```\n\nThe user-facing commands are:\n\n```bash\nagy\na\nagy-va39\n```\n\n`agy` and `a` should both run the `agy-va39` wrapper.\n\n## Requirements\n\nInstall or verify these tools in Termux:\n\n```bash\npkg update\npkg install python proot curl ca-certificates\n```\n\nYou also need a Termux-compatible glibc installation that provides these files:\n\n```text\n/data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1\n/data/data/com.termux/files/usr/glibc/lib/libc.so.6\n```\n\nVerify them:\n\n```bash\ntest -x /data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1\ntest -f /data/data/com.termux/files/usr/glibc/lib/libc.so.6\n```\n\nYou also need the official Linux ARM64 `agy` binary installed at:\n\n```text\n~/.local/bin/agy\n```\n\nVerify the binary exists:\n\n```bash\ntest -x ~/.local/bin/agy\nfile ~/.local/bin/agy\n```\n\nThe `file` output should identify it as an ARM64 Linux ELF binary.\n\n## Step 0: Install the Official Antigravity CLI Binary\n\nSkip this step if `~/.local/bin/agy` already exists.\n\nRun the official install script:\n\n```bash\ncurl -fsSL https://antigravity.google/cli/install.sh | bash\n\n## Step 1: Create the Generalized VA39 Patch Script\n\nCreate `~/patch_agy_va39.py`:\n\n```python\n#!/usr/bin/env python3\n\"\"\"\nGeneralized VA39 patch for the agy linux_arm64 binary.\n\nBased on hjotha's analysis in:\nhttps://github.com/google-antigravity/antigravity-cli/issues/64\n\nThis scans instruction patterns instead of using fixed offsets, so it can work\nacross builds where the relevant TCMalloc code moved.\n\"\"\"\n\nimport hashlib\nimport shutil\nimport struct\nimport sys\nfrom pathlib import Path\n\n\nsrc = Path(sys.argv[1] if len(sys.argv) > 1 else str(Path.home() / \".local/bin/agy\"))\ndst = Path(str(src) + \".va39\")\n\nif not src.exists():\n    raise SystemExit(f\"Input binary does not exist: {src}\")\n\nprint(f\"Input binary : {src}\")\nprint(f\"SHA256 in    : {hashlib.sha256(src.read_bytes()).hexdigest()}\")\nprint()\n\nshutil.copyfile(src, dst)\ndata = bytearray(dst.read_bytes())\n\n\ndef get(off):\n    return struct.unpack_from(\"<I\", data, off)[0]\n\n\ndef put(off, word):\n    struct.pack_into(\"<I\", data, off, word)\n\n\n# 1. Find google_malloc section via ELF header parsing.\nlo, hi = 0, len(data)\n\n\ndef find_section(name_target):\n    if data[:4] != b\"\\x7fELF\":\n        return None, None\n\n    e_shoff = struct.unpack_from(\"<Q\", data, 40)[0]\n    e_shentsize = struct.unpack_from(\"<H\", data, 58)[0]\n    e_shnum = struct.unpack_from(\"<H\", data, 60)[0]\n    e_shstrndx = struct.unpack_from(\"<H\", data, 62)[0]\n\n    shstr_base = e_shoff + e_shstrndx * e_shentsize\n    shstr_off = struct.unpack_from(\"<Q\", data, shstr_base + 24)[0]\n\n    for i in range(e_shnum):\n        base = e_shoff + i * e_shentsize\n        sh_name = struct.unpack_from(\"<I\", data, base)[0]\n        sh_offset = struct.unpack_from(\"<Q\", data, base + 24)[0]\n        sh_size = struct.unpack_from(\"<Q\", data, base + 32)[0]\n\n        nend = data.index(b\"\\x00\", shstr_off + sh_name)\n        section = data[shstr_off + sh_name : nend].decode(\"utf-8\", errors=\"replace\")\n        if section == name_target:\n            return sh_offset, sh_offset + sh_size\n\n    return None, None\n\n\nsec_lo, sec_hi = find_section(\"google_malloc\")\nif sec_lo is not None:\n    lo, hi = sec_lo, sec_hi\n    print(f\"Found google_malloc section: file 0x{lo:x} - 0x{hi:x} ({(hi - lo) // 1024} KB)\")\nelse:\n    print(\"google_malloc section not found - scanning entire binary.\")\n    print(\"This is slower but may still work.\")\nprint()\n\n# 2. ubfx #42,#3 -> #35,#3 and lsl #42 -> #35.\n# These move TCMalloc's tag extraction/insertion from bit 42 to bit 35.\nubfx_count = 0\nlsl_count = 0\nfor off in range(lo, hi, 4):\n    w = get(off)\n    if (w & 0x7F800000) == 0x53000000:  # bitfield-move family\n        immr = (w >> 16) & 0x3F\n        imms = (w >> 10) & 0x3F\n        if immr == 42 and imms == 44:  # ubfx Xn, Xm, #42, #3\n            put(off, (w & ~((0x3F << 16) | (0x3F << 10))) | (35 << 16) | (37 << 10))\n            ubfx_count += 1\n        elif immr == 22 and imms == 21:  # lsl Xn, Xm, #42 encoded as lsr\n            put(off, (w & ~((0x3F << 16) | (0x3F << 10))) | (29 << 16) | (28 << 10))\n            lsl_count += 1\n\nprint(f\"[1] ubfx patches : {ubfx_count}  (expect ~15)\")\nprint(f\"    lsl  patches : {lsl_count}   (expect ~2)\")\n\n# 3. Random address mask pairs.\n# mov x10, #-0x6c00000001; movk x10, #0, lsl #48\n# -> mov x10, #-1; lsr x10, x10, #29\n# Gives x10 = 0x7ffffffff, a 39-bit address mask.\nmask_count = 0\nfor off in range(lo, hi - 4, 4):\n    if get(off) == 0x92D3800A and get(off + 4) == 0xF2E0000A:\n        put(off, 0x9280000A)\n        put(off + 4, 0xD35DFD4A)\n        mask_count += 1\n\nprint(f\"[2] Random mask  : {mask_count}  (expect ~3)\")\n\n# 4. MmapAlignedLocked upper bound: 1 << 48 -> 1 << 39.\nmmap_count = 0\nfor off in range(lo, hi, 4):\n    if get(off) == 0xF2E00029:\n        put(off, 0xD3596129)\n        mmap_count += 1\n\nprint(f\"[3] MmapAligned  : {mmap_count}  (expect ~1)\")\n\n# 5. Inlined tag constants and fast-path deallocation masks.\n# Move tag placement from bit 42 to bit 35.\nword_rewrites = {\n    0xD2C20009: 0xD2C00409,  # normal P0 tag x9: 4 << 42 -> 4 << 35\n    0xD2C2000A: 0xD2C0040A,  # normal P0 tag x10\n    0xF2C20008: 0xF2DFF408,  # normal dealloc mask x8\n    0xF2C20009: 0xF2DFF409,  # normal dealloc mask x9\n    0xD2C10009: 0xD2C00209,  # cold tag x9: 2 << 42 -> 2 << 35\n    0xD2C1000A: 0xD2C0020A,  # cold tag x10\n    0xF2C38008: 0xF2DFF708,  # cold/tagged dealloc mask x8\n    0xF2C38009: 0xF2DFF709,  # cold/tagged dealloc mask x9\n    0x92560A6C: 0x925D0A6C,  # tag mask 0x1c0000000000 -> 0x3800000000 x12\n    0x92560A6A: 0x925D0A6A,  # tag mask x10\n    0xD2C3000D: 0xD2C0060D,  # normal P1 tag x13: 6 << 42 -> 6 << 35\n    0xD2C3000C: 0xD2C0060C,  # normal P1 tag x12\n    0xD2C08008: 0xD2C00108,  # kTagFree: 1 << 42 -> 1 << 35\n}\ncounts = {old: 0 for old in word_rewrites}\nfor off in range(lo, hi, 4):\n    w = get(off)\n    if w in word_rewrites:\n        put(off, word_rewrites[w])\n        counts[w] += 1\n\nprint(f\"[4] Tag constants: {sum(counts.values())} words rewritten\")\n\n# 6. Android/Termux syscall compatibility.\n# Go's faccessat2 syscall can be killed by Android seccomp with SIGSYS. The\n# old faccessat syscall is enough for os/exec.LookPath checks on Termux.\nfaccessat2_count = 0\nfor off in range(0, len(data) - 12, 4):\n    if (\n        get(off) == 0xAA1F03E5\n        and get(off + 4) == 0xAA1F03E6\n        and get(off + 8) == 0xD28036E0\n        and (get(off + 12) & 0xFC000000) == 0x94000000\n    ):\n        put(off + 8, 0xD2800600)  # mov x0, #48; syscall.SYS_FACCESSAT\n        faccessat2_count += 1\n\nprint(f\"[5] faccessat2   : {faccessat2_count} syscall wrapper rewritten\")\n\ndst.write_bytes(data)\ndst.chmod(0o755)\n\nout_sha = hashlib.sha256(dst.read_bytes()).hexdigest()\nprint()\nprint(f\"SHA256 out   : {out_sha}\")\nprint(f\"Output       : {dst}\")\nprint()\n\ntotal = ubfx_count + lsl_count + mask_count + mmap_count + sum(counts.values()) + faccessat2_count\nif total == 0:\n    print(\"WARNING: No patches applied - binary structure may have changed.\")\n    print(\"Do NOT use the output binary.\")\nelif ubfx_count == 0 or mask_count == 0:\n    print(\"WARNING: Some expected patches were not found.\")\n    print(\"The patch may be incomplete - test carefully.\")\nelse:\n    print(\"Patch looks complete. Now test with:\")\n    print()\n    print(\"  GLIBC=/data/data/com.termux/files/usr/glibc/lib\")\n    print(\"  $GLIBC/ld-linux-aarch64.so.1 --library-path $GLIBC \\\\\")\n    print(f\"    {dst} --version\")\n```\n\nMake it executable:\n\n```bash\nchmod +x ~/patch_agy_va39.py\n```\n\n## Step 2: Patch the Official Binary\n\nRun the script against the original official binary:\n\n```bash\npython3 ~/patch_agy_va39.py ~/.local/bin/agy\n```\n\nThe script creates:\n\n```text\n~/.local/bin/agy.va39\n```\n\nThe original binary remains unchanged:\n\n```text\n~/.local/bin/agy\n```\n\nHealthy output should show nonzero patch counts. On the tested build, the counts were:\n\n```text\n[1] ubfx patches : 15\n    lsl  patches : 2\n[2] Random mask  : 3\n[3] MmapAligned  : 1\n[4] Tag constants: 108 words rewritten\n[5] faccessat2   : 1 syscall wrapper rewritten\n```\n\nFuture builds may have different tag constant counts, but these are important signs:\n\n```text\nubfx patches should not be 0\nRandom mask should not be 0\nMmapAligned should usually be nonzero\nfaccessat2 may be 0 if Go or the binary changed\n```\n\nIf the script says no patches were applied, do not use the generated output.\n\n## Step 3: Create the glibc `libc.so` Shim\n\nSome parts of the program or its dependencies may try to load `libc.so` dynamically. In the Termux glibc layout, `libc.so` can be an ASCII linker script instead of an ELF shared object. glibc's dynamic loader rejects that with `invalid ELF header`.\n\nCreate a tiny shim directory where both `libc.so` and `libc.so.6` point to the real ELF library:\n\n```bash\nmkdir -p ~/.local/lib/agy-glibc\nln -sfn /data/data/com.termux/files/usr/glibc/lib/libc.so.6 ~/.local/lib/agy-glibc/libc.so\nln -sfn /data/data/com.termux/files/usr/glibc/lib/libc.so.6 ~/.local/lib/agy-glibc/libc.so.6\n```\n\nVerify:\n\n```bash\nfile ~/.local/lib/agy-glibc/libc.so\nfile /data/data/com.termux/files/usr/glibc/lib/libc.so.6\n```\n\n`libc.so` in the shim should be a symlink to the real `libc.so.6`.\n\n## Step 4: Create the Termux Wrapper\n\nCreate `~/.local/bin/agy-va39`:\n\n```sh\n#!/data/data/com.termux/files/usr/bin/sh\nG=/data/data/com.termux/files/usr/glibc/lib\nS=/data/data/com.termux/files/home/.local/lib/agy-glibc\nunset LD_PRELOAD\nunset LD_LIBRARY_PATH\nexport GODEBUG=netdns=go\nexport SSL_CERT_FILE=/data/data/com.termux/files/usr/etc/tls/cert.pem\nexec /data/data/com.termux/files/usr/bin/proot \\\n  -b /data/data/com.termux/files/usr/etc/resolv.conf:/etc/resolv.conf \\\n  $G/ld-linux-aarch64.so.1 --library-path $S:$G \\\n  /data/data/com.termux/files/home/.local/bin/agy.va39 \"$@\"\n```\n\nMake it executable:\n\n```bash\nchmod +x ~/.local/bin/agy-va39\n```\n\nWhy each line matters:\n\n```text\nG points to the Termux glibc loader and libraries.\nS points to the shim directory where libc.so resolves to libc.so.6.\nunset LD_PRELOAD prevents Termux's Bionic preload from entering a glibc process.\nunset LD_LIBRARY_PATH prevents host Termux library paths from polluting glibc resolution.\nGODEBUG=netdns=go forces Go's pure DNS resolver.\nSSL_CERT_FILE points TLS verification at Termux's CA bundle.\nproot binds Termux's resolver config into /etc/resolv.conf for the glibc program.\n--library-path $S:$G makes glibc search the shim first, then the real glibc libs.\n```\n\n## Step 5: Add Shell Shortcuts\n\nMake sure `~/.local/bin` is in `PATH`. Add this near the top of `~/.bashrc` if it is not already present:\n\n```bash\nexport PATH=\"$HOME/.local/bin:$HOME/bin:$PATH\"\n```\n\nAdd these functions to `~/.bashrc`:\n\n```bash\nagy() {\n  hash -r\n  agy-va39 \"$@\"\n}\n\na() {\n  hash -r\n  agy-va39 \"$@\"\n}\n```\n\nReload the shell config:\n\n```bash\nsource ~/.bashrc\n```\n\nThe `hash -r` line clears Bash's command lookup cache. This matters when `agy` previously pointed at a different binary, alias, or wrapper.\n\n## Step 6: Verify the Setup\n\nCheck the wrapper directly:\n\n```bash\nagy-va39 --version\n```\n\nCheck the shortcuts:\n\n```bash\nagy --version\na --version\n```\n\nThen start the interactive CLI:\n\n```bash\nagy\n```\n\nIf `agy` starts but complains about login or authentication, the native binary is running. At that point the remaining issue is account/auth flow, not the Termux compatibility layer.\n\n## Updating Antigravity Later\n\nWhen a new Antigravity release is installed, the official binary at `~/.local/bin/agy` may be replaced. Repeat only the patch step:\n\n```bash\npython3 ~/patch_agy_va39.py ~/.local/bin/agy\n```\n\nThen test:\n\n```bash\nagy-va39 --version\nagy --version\n```\n\nThe wrapper usually does not need to change after an Antigravity update.\n\nIf future Antigravity releases include an official VA39-compatible Linux ARM64 build, the TCMalloc patch may no longer be needed. The Termux wrapper may still be useful for glibc, DNS, certificates, and preload cleanup.\n\n## Problems Encountered and the Working Fixes\n\n### 1. TCMalloc failed before startup\n\nObserved error:\n\n```text\nMmapAligned() failed - unable to allocate with tag\nTCMalloc assumes a 48-bit virtual address space size\nFATAL ERROR: Out of memory trying to allocate internal tcmalloc data\n```\n\nCause:\n\n```text\nThe binary was built with TCMalloc constants for a 48-bit ARM64 userspace VA.\nMany Android/Termux devices use a 39-bit userspace VA layout.\nTCMalloc generated mmap hints above the address range accepted by the kernel.\n```\n\nWorking fix:\n\n```text\nPatch TCMalloc's inlined address/tag constants from bit 42 to bit 35.\nPatch the random mmap address mask to 39 bits.\nPatch the MmapAligned upper bound from 1 << 48 to 1 << 39.\nPatch tag/deallocation masks, not only RandomMmapHint.\n```\n\n### 2. `SIGSYS: bad system call` from `faccessat2`\n\nObserved error:\n\n```text\nSIGSYS: bad system call\nsyscall.faccessat2\nos/exec.findExecutable\n```\n\nCause:\n\n```text\nGo used the newer faccessat2 syscall. Android seccomp blocked it.\nThe kernel killed the process with SIGSYS before the CLI could continue.\n```\n\nWorking fix:\n\n```text\nPatch the Go syscall wrapper from faccessat2 syscall 439 to older faccessat syscall 48.\n```\n\nThis is included in `patch_agy_va39.py`.\n\n### 3. `invalid ELF header` for glibc `libc.so`\n\nObserved error:\n\n```text\nerror while loading shared libraries: /data/data/com.termux/files/usr/glibc/lib/libc.so: invalid ELF header\n```\n\nCause:\n\n```text\nThe file named libc.so in the Termux glibc directory can be a linker script, not an ELF shared object.\nThe runtime loader or a dlopen path needed an actual shared object.\n```\n\nWorking fix:\n\n```text\nCreate ~/.local/lib/agy-glibc/libc.so as a symlink to glibc's real libc.so.6.\nPut that shim directory before the glibc lib directory in --library-path.\n```\n\n### 4. `LIBC not found` from `libtermux-exec-ld-preload.so`\n\nObserved error:\n\n```text\nversion `LIBC' not found (required by /data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so)\n```\n\nCause:\n\n```text\nTermux can set LD_PRELOAD to inject libtermux-exec-ld-preload.so.\nThat library is built for Android's Bionic libc, not glibc.\nPreloading it into a glibc process breaks symbol/version resolution.\n```\n\nWorking fix:\n\n```sh\nunset LD_PRELOAD\nunset LD_LIBRARY_PATH\n```\n\nThese lines are in the wrapper before invoking the glibc loader.\n\n### 5. DNS looked up `oauth2.googleapis.com` through `[::1]:53`\n\nObserved behavior:\n\n```text\nlookup oauth2.googleapis.com on [::1]:53\n```\n\nCause:\n\n```text\nThe glibc-loaded binary did not see Termux's resolver config at /etc/resolv.conf.\nOn this setup, /etc/resolv.conf did not exist, while Termux's resolver file existed at:\n/data/data/com.termux/files/usr/etc/resolv.conf\n```\n\nWorking fix:\n\n```text\nUse proot to bind Termux's resolver file into /etc/resolv.conf for the launched process.\nForce Go's pure resolver with GODEBUG=netdns=go.\n```\n\nWrapper lines:\n\n```sh\nexport GODEBUG=netdns=go\nexec /data/data/com.termux/files/usr/bin/proot \\\n  -b /data/data/com.termux/files/usr/etc/resolv.conf:/etc/resolv.conf \\\n  ...\n```\n\n### 6. TLS verification failed after DNS worked\n\nCause:\n\n```text\nThe glibc process did not automatically know where Termux's CA certificate bundle lives.\n```\n\nWorking fix:\n\n```sh\nexport SSL_CERT_FILE=/data/data/com.termux/files/usr/etc/tls/cert.pem\n```\n\nVerify the file exists:\n\n```bash\ntest -f /data/data/com.termux/files/usr/etc/tls/cert.pem\n```\n\n### 7. `agy` command still pointed at the wrong thing\n\nCause:\n\n```text\nBash caches command paths. Existing aliases or old command lookups can persist in a running shell.\n```\n\nWorking fix:\n\n```bash\nagy() {\n  hash -r\n  agy-va39 \"$@\"\n}\n\na() {\n  hash -r\n  agy-va39 \"$@\"\n}\n```\n\n## Quick Health Checks\n\nUse these commands when debugging:\n\n```bash\ntype agy\ntype a\ntype agy-va39\n```\n\n```bash\nagy-va39 --version\nagy --version\na --version\n```\n\n```bash\nfile ~/.local/bin/agy\nfile ~/.local/bin/agy.va39\nfile /data/data/com.termux/files/usr/glibc/lib/libc.so\nfile /data/data/com.termux/files/usr/glibc/lib/libc.so.6\n```\n\n```bash\ntest -f /data/data/com.termux/files/usr/etc/resolv.conf\ntest -f /data/data/com.termux/files/usr/etc/tls/cert.pem\n```\n\n```bash\ncurl -I https://oauth2.googleapis.com\n```\n\nIf `curl` works but `agy` has DNS or TLS errors, check the wrapper's `GODEBUG`, `proot` bind, and `SSL_CERT_FILE` lines.\n\n## Known Caveats\n\nThis is still a binary patch. It is practical, but it is not as robust as an official VA39-compatible build.\n\nThe correct upstream fix would be one of these:\n\n```text\nBuild the Linux ARM64 binary with TCMALLOC_ADDRESS_BITS=39.\nProvide a runtime VA-aware TCMalloc configuration.\nProvide a non-TCMalloc Linux ARM64 binary.\nProvide an official Android/Termux-compatible build.\n```\n\nThe patch script is intentionally conservative. If expected instruction patterns disappear, do not assume the output is safe. Re-check the binary, update the pattern scanner, or wait for an official build.\n\n## Minimal Repeat Workflow\n\nFor future Antigravity updates, the short version is:\n\n```bash\npython3 ~/patch_agy_va39.py ~/.local/bin/agy\nchmod +x ~/.local/bin/agy.va39\nagy-va39 --version\nagy --version\n```\n## Updating Antigravity Later\n\nWhen a new Antigravity release is installed, repeat only Steps 0 and 2:\n\n```bash\ncurl -fsSL https://antigravity.google/cli/install.sh | bash\npython3 ~/patch_agy_va39.py ~/.local/bin/agy\nagy-va39 --version\nagy --version\n\nIf `agy-va39` already exists and the wrapper has not been changed, you usually do not need to recreate the wrapper or shell functions.\n\n## Updating Antigravity Later\n\nWhen a new Antigravity release is installed, repeat only Steps 0 and 2:\n\n```bash\ncurl -fsSL https://antigravity.google/cli/install.sh | bash\npython3 ~/patch_agy_va39.py ~/.local/bin/agy\nagy-va39 --version\nagy --version\n\n## Final Working Wrapper\n\nKeep this as the known-good wrapper:\n\n```sh\n#!/data/data/com.termux/files/usr/bin/sh\nG=/data/data/com.termux/files/usr/glibc/lib\nS=/data/data/com.termux/files/home/.local/lib/agy-glibc\nunset LD_PRELOAD\nunset LD_LIBRARY_PATH\nexport GODEBUG=netdns=go\nexport SSL_CERT_FILE=/data/data/com.termux/files/usr/etc/tls/cert.pem\nexec /data/data/com.termux/files/usr/bin/proot \\\n  -b /data/data/com.termux/files/usr/etc/resolv.conf:/etc/resolv.conf \\\n  $G/ld-linux-aarch64.so.1 --library-path $S:$G \\\n  /data/data/com.termux/files/home/.local/bin/agy.va39 \"$@\"\n```", "url": "https://wpnews.pro/news/working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without", "canonical_source": "https://gist.github.com/Brajesh2022/e42160d29b55417db6c18c52dd1d6d37", "published_at": "2026-05-22 10:40:25+00:00", "updated_at": "2026-05-22 14:46:03.599604+00:00", "lang": "en", "topics": ["developer-tools", "open-source", "products"], "entities": ["Antigravity CLI", "Termux", "Android", "TCMalloc", "Go", "Bionic", "glibc", "ARM64"], "alternates": {"html": "https://wpnews.pro/news/working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without", "markdown": "https://wpnews.pro/news/working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without.md", "text": "https://wpnews.pro/news/working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without.txt", "jsonld": "https://wpnews.pro/news/working-setup-for-running-antigravity-cli-agy-natively-on-android-termux-without.jsonld"}}