Alert · AnswerAlert · AnswerPrompt · PressAlertButton
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Read a system dialog, or answer it. These call app_alert.
Alert
func (d *Device) Alert(ctx context.Context) (string, error)
Alert reports what a system dialog says, or "" when none is up.
A permission prompt is another process's window, not the app's. Reading it needs no knowledge of what the buttons say, which is the point.
AnswerAlert
func (d *Device) AnswerAlert(ctx context.Context, accept bool) error
AnswerAlert accepts or dismisses a dialog of one or two buttons: accept is yes and dismiss is no, so a two-button permission prompt is granted by accept and denied by dismiss, in any language. A dialog of three or more is refused, naming its buttons — more than one may mean yes, as on iOS's location prompt — so press one with PressAlertButton.
AnswerPrompt
func (d *Device) AnswerPrompt(ctx context.Context, text string, accept bool) error
AnswerPrompt types text into a dialog's field, then accepts or dismisses it, in one call. A plain alert has no field, and the platform refuses the text. What accept and dismiss press is as for AnswerAlert.
PressAlertButton
func (d *Device) PressAlertButton(ctx context.Context, button string) (string, error)
PressAlertButton presses a dialog's button by its caption — in any case, with straight or curly quotes — or by its position from 1 in the order the dialog shows them, and returns the caption it pressed. It works on any dialog, one of three buttons or an app's own included.
Examples
Ask whether a dialog is up, what it says, and its buttons
text, err := dev.Alert(ctx)
if err != nil {
return err
}
if text != "" {
fmt.Println("dialog up:", text)
}
The same call from the command line, mobium alert, printed on an Android 15 emulator:
a dialog is on screen: "Discard changes?\nThey will be lost."
buttons: "KEEP EDITING", "DISCARD"

mobium alert on an Android 15 emulator
Say yes to a dialog of one or two buttons
if err := dev.AnswerAlert(ctx, true); err != nil {
return err
}
The same call from the command line, mobium alert accept, printed on an Android 15 emulator:
accepted the dialog "Discard changes?\nThey will be lost.": pressed "DISCARD"
| Before | After |
|---|---|
![]() | ![]() |
mobium alert accept on an Android 15 emulator
Press a button by its caption, on a dialog of three
pressed, err := dev.PressAlertButton(ctx, "Don't Save")
if err != nil {
return err
}
fmt.Println("pressed", pressed)
The same call from the command line, mobium alert --button "Don't Save", printed on an Android 15 emulator:
pressed "DON'T SAVE" on the dialog "Save this draft?\nYou can come back to it later."
| Before | After |
|---|---|
![]() | ![]() |
mobium alert --button "Don't Save" on an Android 15 emulator
More examples
Fill a prompt's field and accept it, in one call
if err := dev.AnswerPrompt(ctx, "Groceries", true); err != nil {
return err
}



