Skip to content

About

Route coding-agent browser, iOS Simulator, and Android sessions across local hardware and free-tier clouds at $0 — deterministic quota locks, verified closure, and odr.receipt/v1 receipts. MIT.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OpenDeviceRouter

Give coding agents eyes on real browsers, iOS simulators, and Android phones at $0.

One call gets your agent or test runner an iOS Simulator or Android device from your own machine, a free GitHub runner, or a device cloud you already have an account with. It installs your build, waits until the screen can be captured, hands you screenshot, tap, type, swipe and key input, then releases the device and proves it closed. Every session ends with a machine-readable receipt.

Quick start · Get keys · SDK · Midscene · Benchmarks · For agents · Soul · Roadmap

Pre-release (0.1.0). Not on npm yet; install from this repository. What is measured and what is only vendor-documented is labelled throughout.

Measured on public CI (results, method). Run to first frame = allocate() called until the first usable screenshot of the freshly installed fixture app, on a device odr booted for that sample, with verified closure. Some Android samples so far started from the emulator's quick-boot snapshot; the method page lists them.

Where Device Sessions (OK + closed) Run to first frame, median Screenshot misses while held Last run
GitHub-hosted runner (ubuntu-24.04) sdk_gphone64_x86_64, Android 14 9 of 21 across 7 run(s) 47.6 s 0 of 141 2026-11-23
GitHub-hosted runner (macos-15) iPhone 17, iOS 26.0.1 16 of 21 across 7 run(s) 162.4 s 0 of 126 2026-11-23

Small samples; read the limits in the method page. Cloud providers are not in this table until their terms allow publication.

Why

A coding agent in a Linux sandbox cannot boot an iOS Simulator and has no phone to tap. Device clouds can, and several have free allowances, but each has its own signup, key, session limit, concurrency cap and billing behavior. Agents leak sessions when a run crashes, and free tiers quietly turn into overage.

OpenDeviceRouter handles the part around the device:

  • Route on what the run needs: platform, model, OS range, build format, inputs, keys, session length, parallel sessions.
  • Reserve capacity under a file lock before launch, so eight parallel workers cannot all spend the same 30 free minutes.
  • Refuse in free-only mode when the provider would bill and odr cannot verify the remaining allowance.
  • Release on success, failure, Ctrl-C, SIGTERM, uncaught exceptions and process exit; odr sweep cleans up after workers that died outright.
  • Verify closure from the provider's own session list or the local simulator/emulator state.
  • Receipt for every session (odr.receipt/v1): route, actual device identity, timings, screenshot health, usage and closure. No credentials and no session handle in it.

Device control is agent-device (MIT) for local, GitHub runners, Limrun, Revyl and AWS Device Farm, and the Appetize CLI for Appetize. odr does not reimplement device control.

Quick start

Needs Node.js 22.12 or newer.

git clone https://github.com/QA-army/open-device-router.git
cd open-device-router
npm install && npm run build && npm link     # puts `odr` on your PATH
npm i agent-device                           # device control for local and agent-device clouds
# or, from another project: npm i github:QA-army/open-device-router agent-device

odr doctor                                   # what is installed, connected and missing
odr connect local --done                     # your own machine is a provider
odr run --platform android --build app.apk --minutes 10 -- npx my-agent

odr run allocates, installs, launches, waits for the first usable frame, then runs your command with ODR_SESSION_FILE set. When the command exits, for any reason, the device is released and the receipt is written. Exit codes: 0 ok, 3 refused by policy, 4 session failed, 5 closure could not be verified.

Dry run first if you want to see the decision:

odr plan --platform ios --model "iPhone 16" --os ">=18" --build-format app-zip --minutes 10

Add a cloud

odr keys revyl            # where to sign up, which key, which env var, the gh secret line
export REVYL_API_KEY=...
odr connect revyl --done
odr run --platform ios --minutes 10 -- npx my-agent

You sign up yourself; odr never creates accounts or accepts terms. Every provider's steps are in docs/keys.md, generated from the registry.

Targets

Free allowances are vendor-documented on the date shown, not measured. Each links the page it came from.

Target Devices Free allowance (checked 2026-11-22) Session cap Parallel Control After the free allowance
Local Your simulators, emulators, USB devices Your hardware none your machine agent-device n/a
GitHub-hosted runners iOS Simulator (macOS runner), Android emulator (Ubuntu + KVM) Free on public repositories (GitHub docs) job timeout per plan agent-device n/a on public repos
Appetize iOS Simulator, Android emulator Free: 30 min a month, 3-minute sessions, 2 devices (pricing) 3 min on Free 2 on Free Appetize CLI Free throttles; Starter and Premium bill $0.06/min after 500 min
Revyl iOS Simulator, Android emulator Up to 1,200 device minutes a month (pricing) see registry 2 agent-device see registry
Limrun iOS Simulator, Android emulator 120 one-time credits (pricing) see registry see registry agent-device see registry
AWS Device Farm Real iOS and Android devices 1,000 one-time device minutes (FAQ) 150 min per account agent-device bills per minute; free-only never routes here

Exact device profiles, inputs, keys, build formats and limits per provider: odr show <id> or registry/providers/. Fourteen more providers, including browser clouds, are researched or candidate entries: docs/free-tiers.md.

SDK

import { allocate } from "opendevicerouter";

const session = await allocate(
  { platform: "android", model: "pixel", os: ">=14", build_format: "apk", needs: ["tap", "type", "swipe"], minutes: 10 },
  { build: { format: "apk", path: "app.apk" } },
);
try {
  const shot = await session.screenshot();          // { png, width, height } in input coordinates
  await session.tap(shot.width / 2, shot.height / 2);
  await session.type("hello");
  await session.key("enter");
  console.log(session.device);                       // actual model, OS and device id, confirmed by provider or driver
} finally {
  const receipt = await session.release();           // idempotent; also runs on signals and crashes
}

withSession(request, opts, fn) does the same with release built in. allocate throws RouteRefusedError or SessionError; both carry the receipt.

From a process started by odr run:

import { attach } from "opendevicerouter";
const session = await attach();   // reads ODR_SESSION_FILE; talks to odr over loopback with a bearer token

Midscene

import { allocate } from "opendevicerouter";
import { midsceneInterface } from "opendevicerouter/midscene";

const session = await allocate({ platform: "ios", minutes: 10 }, { launch: "com.apple.Preferences" });
const device = midsceneInterface(session);   // screenshotBase64, size, Tap, Input, KeyboardPress, Swipe
// pass `device` to Midscene's Agent, per https://midscenejs.com/integrate-with-any-interface.html

Screenshots are available for the whole session: every heartbeat takes one, and two misses in a row mark the session dropped with screenshot_lost in the receipt. odr does not record video; bring your own.

Spend controls

Mode Behavior
free-only (default) Uses only allowances that cannot bill, or that bill but were reconciled with the provider's usage API in the last 24 hours. Refuses when overage behavior is unknown.
--budget-usd n Prices every minute that is not provably free and refuses above n per session and above the connection's --max-usd-month.

Reservations are taken under a lock before the provider is called, and released or settled after. odr reconcile appetize pulls the provider's own usage figure; providers without a usage API stay labelled as local estimates.

Benchmarks

Published numbers come from committed result files produced by CI on this public repository. The summary page is generated from them and CI fails if the two disagree. Nobody types a number into it.

  • Session benchmark: Run to first frame of a fixture app, allocate, install, launch, hold with screenshots every 5 s, tap check, teardown, closure.
  • Cold boot benchmark: device only.
  • Results: bench/RESULTS.md · Method and publishing rules: bench/METHODOLOGY.md

Cloud results are published only when the provider's terms allow it; until then they stay as CI artifacts.

Security

  • No credentials stored. odr checks that an env var is set and passes it to the driver; it never writes it.
  • The private session handle lives in ~/.opendevicerouter/sessions/<id>.json (mode 0600) with a random bearer token for the loopback control server. Receipts never contain it.
  • Uploaded builds are private to your provider account and deleted on release where the provider allows it.
  • One account per provider per organization. odr does not create accounts, rotate trials, or bypass signup steps. See docs/account-policy.md.

For agents

  • Soul & operating guide: SOUL.md · AGENTS.md · Machine summary: llms.txt · Keys: docs/keys.md or odr keys --all
  • Machine-readable output: odr plan --json, odr run --json, odr providers --json, odr status --json.
  • Receipt schema: schema/receipt.schema.json.
  • Always release: use withSession, or odr run -- <cmd>, and run odr sweep at the start of CI jobs.

What this is not

  • Not a device host. Sessions run on your machine or on clouds you have an account with.
  • Not a test framework. It does not decide what to test or whether a result is a bug.
  • Not a way to pool, share, or rotate free trials.

Contributing

The most useful contribution is a correction to a provider entry, with a link to the vendor page. See CONTRIBUTING.md.

Ecosystem, license, and affiliation

MIT. Built by Perirun and maintained by QA.army (opendevicerouter.com).

OpenDeviceRouter stands alone as a $0 session router for any coding agent or runner, and serves as the first-class device/browser routing layer inside the MIT self-hosted QA-army/qa.army platform alongside QA-army/cli, QA-army/mcp, and QA-army/skills. OpenDeviceRouter decides where a session runs, keeps it alive, and proves closure (odr.receipt/v1); orchestrating durable Test workflows, run memory, PR gates, and human-reviewed draft fix PRs belongs to qa.army (self-hosted MIT and Cloud) and Perirun (air-gapped enterprise perimeters).

Not affiliated with, sponsored by, or endorsed by any provider or tool named here. Product names are used only to identify the services described.

About

Route coding-agent browser, iOS Simulator, and Android sessions across local hardware and free-tier clouds at $0 — deterministic quota locks, verified closure, and odr.receipt/v1 receipts. MIT.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages