Skip to main content

app_context

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

Switch between the native shell and a WebView, or report the current context when called with no argument. While a WebView context is active, app_map and app_tap operate on the page's elements; taps are still delivered as real touches on the device.

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

Arguments​

NameTypeRequiredWhat it is
contextstringA context id from app_contexts, or "NATIVE_APP" to return to the native shell. Omit to read the current context.
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).

Examples​

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

Drive the web content of a WebView​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_context",
"arguments": {
"context": "WEBVIEW_com.example.shop"
}
}
}

Go back to the native app​

{
"context": "NATIVE_APP"
}

On a device​

mobium context WEBVIEW_dev.mobium.mobiumapp on an Android 15 emulator

mobium context WEBVIEW_dev.mobium.mobiumapp on an Android 15 emulator