Skip to content

[Bug]: getBinaryName() missing 'android' platform case — crashes on Termux/Node.js #1477

Description

@wesamahakem

Bug Description

When running agent-browser on Termux (Android), the CLI crashes with:

Error: Unsupported platform: android-arm64

Root Cause

In bin/agent-browser.js, the getBinaryName() function (around line 33-47) has a switch on process.platform that only handles darwin, linux, and win32. On Termux, Node.js reports process.platform === "android", which falls through to the default/throw branch.

Steps to Reproduce

  1. Install Node.js on Termux (Android) — pkg install nodejs
  2. Install agent-browser — npm install -g agent-browser
  3. Run npx agent-browser --version (or any command)
  4. Observe: Error: Unsupported platform: android-arm64

Expected Behavior

The agent-browser package already ships agent-browser-linux-arm64 in node_modules/ (the glibc binary). The CLI should treat android as a Linux variant (the same way the code already does for spawning grun on lines 97-100):

if (platform() === 'android') {
  executable = 'grun';
  args = [binaryPath, ...args];
}

Adding case 'android': osKey = 'linux'; break; to the getBinaryName() switch would allow the binary detection to find the existing linux-arm64 binary, which then works correctly via the existing grun wrapper.

Full error output

Error: Unsupported platform: android-arm64

Environment

  • OS: Android 14 (Termux)
  • Node.js: v26.3.1 (process.platform === "android")
  • agent-browser: 0.26.0
  • Architecture: arm64

Additional context

The linux-arm64 binary (9.2MB) is already shipped and functional on Termux when executed via grun (glibc-runner). The only missing piece is the platform detection in the JS wrapper.

No pre-built android-arm64 binary is needed — mapping androidlinux in getBinaryName() is sufficient, because the existing grun dispatch logic (already present) handles the glibc runner invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions