Skip to main content

Assistant

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

Ask the platform's assistant in typed text, and report what came back: Gemini or Google Assistant on Android, opened with the assist key, its field typed into and sent; Siri on a real iPhone. These call app_assistant.

Assistant​

func (d *Device) Assistant(ctx context.Context, request string, opts AssistantOptions) (AssistantAnswer, error)

Assistant asks the platform's assistant in typed text — Gemini or Google Assistant on Android, Siri on a real iPhone — and reports the text it showed and the app in front afterward. Whether a task was done is for the app to show: name it in opts.App and read Reached.

Examples​

Ask the assistant to open an app, and check that it came forward​

got, err := dev.Assistant(ctx, "Open Clock", mobium.AssistantOptions{App: "com.google.android.deskclock"})
if err != nil {
return err
}
if got.Reached == nil || !*got.Reached {
return fmt.Errorf("Clock did not come forward: %s is in front", got.Front)
}

The same call from the command line, mobium assistant "Open Clock" --app com.google.android.deskclock, printed on an Android 15 emulator:

asked Google Assistant (typed, not spoken): "Open Clock"
it showed no text a screen read can see
in front: com.google.android.deskclock
com.google.android.deskclock came forward

mobium assistant "Open Clock" --app com.google.android.deskclock on an Android 15 emulator

mobium assistant "Open Clock" --app com.google.android.deskclock on an Android 15 emulator

Ask a question, and read the answer it showed​

got, err := dev.Assistant(ctx, "What is 15 times 3", mobium.AssistantOptions{Timeout: 20 * time.Second})
if err != nil {
return err
}
fmt.Println(got.Answer)