Skip to main content

app_dialogs

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

Declare how to answer a dialog, so an action that meets it carries on: when a dialog whose text contains when is in the way of a tap, a type or any action with a target, the button captioned press is pressed, the dialog is confirmed gone, and the action continues — and its result says which dialog was answered. For dialogs that arrive on their own schedule, such as iOS's Save Password after a login. A rule names the button rather than accept or dismiss, because which button those press differs by platform and by dialog (accept on a three-button iOS alert pressed Cancel). Captions match ignoring case. A rule whose button the dialog does not have is refused, listing the buttons it does have. With neither argument it lists the rules; clear removes them. Rules last for the daemon, per device. The share sheet is not a dialog to the platforms' alert detection, so no rule answers it.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
clearbooleanRemove every rule for this device.
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
pressstringThe caption of the button to press, ignoring case.
whenstringText the dialog contains, ignoring case: its title or message.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Answer a dialog whenever it gets in the way​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_dialogs",
"arguments": {
"when": "Save password",
"press": "Not now"
}
}
}

On an Android 15 emulator the answer's text was:

1 dialog rule(s)
when "Save password": press "Not now" (answered 0)

Remove every rule​

{
"clear": true
}

On an Android 15 emulator the answer's text was:

no dialog rules

On a device​

BeforeAfter
Before: With mobium dialogs --when "Discard changes" --press "Keep Editing" declared, mobium tap testid=oneButtonBtn met the Discard dialog in its way, pressed Keep Editing, and went on — its own alert is up, and the line under the title says what the app received — on an Android 15 emulatorAfter: With mobium dialogs --when "Discard changes" --press "Keep Editing" declared, mobium tap testid=oneButtonBtn met the Discard dialog in its way, pressed Keep Editing, and went on — its own alert is up, and the line under the title says what the app received — on an Android 15 emulator

With mobium dialogs --when "Discard changes" --press "Keep Editing" declared, mobium tap testid=oneButtonBtn met the Discard dialog in its way, pressed Keep Editing, and went on — its own alert is up, and the line under the title says what the app received — on an Android 15 emulator