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
- Install Node.js on Termux (Android) —
pkg install nodejs
- Install agent-browser —
npm install -g agent-browser
- Run
npx agent-browser --version (or any command)
- 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 android → linux in getBinaryName() is sufficient, because the existing grun dispatch logic (already present) handles the glibc runner invocation.
Bug Description
When running
agent-browseron Termux (Android), the CLI crashes with:Root Cause
In
bin/agent-browser.js, thegetBinaryName()function (around line 33-47) has aswitchonprocess.platformthat only handlesdarwin,linux, andwin32. On Termux, Node.js reportsprocess.platform === "android", which falls through to the default/throw branch.Steps to Reproduce
pkg install nodejsnpm install -g agent-browsernpx agent-browser --version(or any command)Error: Unsupported platform: android-arm64Expected Behavior
The
agent-browserpackage already shipsagent-browser-linux-arm64innode_modules/(the glibc binary). The CLI should treatandroidas a Linux variant (the same way the code already does for spawninggrunon lines 97-100):Adding
case 'android': osKey = 'linux'; break;to thegetBinaryName()switch would allow the binary detection to find the existinglinux-arm64binary, which then works correctly via the existinggrunwrapper.Full error output
Environment
process.platform === "android")Additional context
The
linux-arm64binary (9.2MB) is already shipped and functional on Termux when executed viagrun(glibc-runner). The only missing piece is the platform detection in the JS wrapper.No pre-built
android-arm64binary is needed — mappingandroid→linuxingetBinaryName()is sufficient, because the existinggrundispatch logic (already present) handles the glibc runner invocation.