mobium hook
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Call a hook the app registered with its gray-box library
A hook is a function the app registered by name with Mobium's gray-box
library — sign in, seed data, raise a toast — so a test can set up state
without walking the UI. The app must be launched with launch --gray-box.
The call is written into a field the library adds only in a gray-box launch,
and the answer read from the device log; what the hook returns is printed as
JSON. On iOS the call is typed, about 16 ms a character. An unknown name is
refused, naming the hooks the app registered.
Usage
mobium hook <name> [args...] [flags]
Flags
| Flag | Type | Default | What it does |
|---|---|---|---|
--timeout-ms | int | 15000 | How long to wait for the app's answer |
And the global flags.
Examples
Call a hook the app registered, and get back what it answered
mobium hook raiseToast "Toast raised by test script"
Printed on an Android 15 emulator:
hook raiseToast answered: "shown"
gray box: the app was idle

mobium hook raiseToast "Toast raised by test script" on MobiumApp, Android 15 emulator, launched with --gray-box: the app's own toast says what the hook was sent
More, from mobium hook --help
mobium launch --gray-box dev.mobium.mobiumapp
mobium hook raiseToast "Toast raised by test script"
mobium hook signIn mobium
mobium hook screen
The tool
hook calls app_hook; its arguments and what every client calls it are there.