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​

public IList<IDictionary<string, object?>> Batch(params IDictionary<string, object?>[] steps)

Runs several tools in order, on this device, in one call:


device.Batch(
Device.Step("app_tap", new Dictionary&lt;string, object?&gt; { ["target"] = "text=Sign in" }),
Device.Step("app_wait_for", new Dictionary&lt;string, object?&gt; { ["target"] = "text=Welcome" }));

Every step is checked before the first runs, and the batch stops at the first failure, throwing 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​

var results = device.Batch(
Device.Step("app_tap", new Dictionary<string, object?> { ["target"] = "text=Network & internet" }),
Device.Step("app_wait_for", new Dictionary<string, object?> { ["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