Skip to main content

batch

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Run several tools in order, on one device, in one call — a known sequence such as tap, type, tap, without a round trip for each. These call app_batch.

batch​

def batch(steps: list[Any]) -> list[dict]

Run several tools in order, on this device, in one call.

Each step is (tool, arguments) or {"name": tool, "arguments": {...}}, with the arguments that tool takes called on its own::

device.batch([
("app_tap", {"target": "text=Sign in"}),
("app_fill", {"target": "testid=user", "text": "mobium"}),
("app_wait_for", {"target": "text=Welcome"}),
])

Every step is checked before the first runs, and the batch stops at the first failure, raising that step's own exception; its details hold step and what completed before it. Returns each step's name, text and data, in order.

Examples​

Tap through two screens in one call​

device.batch([
("app_tap", {"target": "text=Network & internet"}),
("app_wait_for", {"target": "text=Internet"}),
])

The same call from the command line, mobium batch steps.json, printed on an Android 15 emulator:

1. app_tap: tapped text=Network & internet at (407, 867)
2. app_wait_for: text=Internet is visible after 1.222s — @e3 Internet AndroidWifi (button)

mobium batch steps.json on an Android 15 emulator

mobium batch steps.json on an Android 15 emulator