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​

def assistant(request: str, app: str | None=None, timeout: float | None=None) -> dict

Ask the platform's assistant in typed text: Gemini or Google Assistant on Android, Siri on a real iPhone.

Returns the assistant, the answer text it showed (a list, empty when it showed none a screen read can see), the app in front afterward, typed (always true: never spoken) and closed. Whether a task was done is for the app to show: app names the app expected to come forward and reached says whether the assistant handed the request to it. A request that acts for the owner — a call, a message, a purchase — raises InvalidArgumentError without app.

Examples​

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

got = device.assistant("Open Clock", app="com.google.android.deskclock")
assert got["reached"], 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 = device.assistant("What is 15 times 3", timeout=20)
print(got["answer"])