Run multiple commands
batchRuns multiple device commands in one request, executing steps serially and stopping at the first failure when configured, so multi-step interactions avoid separate calls per action.
Instructions
Execute multiple commands in one daemon request. Use it for a known multi-step walk, such as press A, press B, back, instead of one tool call per step. steps is an array of {command, input} objects; input takes the same arguments as that command's own tool (ref, selector, or x and y for targets; settle: true for the settled diff). Steps run serially in one session; onError: "stop" halts at the first failing step, and the result reports the steps that ran. The daemon stops the whole batch after 60 seconds; split longer walks. Example steps, in order (refs such as @e12 come from the last snapshot or settled diff): {"command":"press","input":{"ref":"@e12","settle":true}}, {"command":"press","input":{"selector":"label=Settings","settle":true}}, {"command":"fill","input":{"selector":"id="field-email"","text":"qa@example.com"}}, {"command":"scroll","input":{"direction":"down","until":"label=Privacy","settle":true}}, {"command":"back","input":{"settle":true}}, {"command":"wait","input":{"kind":"text","text":"Saved"}}, {"command":"snapshot","input":{"interactiveOnly":true}}. Times out after 90s.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"steps": "<steps>"
},
"name": "batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Optional output path for command artifacts. | |
| udid | No | Apple device or simulator UDID. | |
| steps | Yes | Structured batch steps. Each step uses a command name and the same input object as that command tool. | |
| device | No | Device name; ids go in udid or serial. | |
| serial | No | Android, HarmonyOS, or Vega VVD serial. | |
| onError | No | Batch failure policy. | |
| session | No | Session name. | |
| maxSteps | No | Maximum number of steps accepted for this batch. | |
| platform | No | Device platform. | |
| deviceTarget | No | Device form factor. |