Skip to main content

app_state

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

What state one app is in: not_installed, not_running, background or foreground — for any app, where app_current names only the one in front. In front means the app owns what is on screen: under its own permission prompt it is still in front, and covered_by names the prompt's process, which is what app_current would report. On iOS a background app also says whether it is suspended; Android has nothing that says, so it does not claim either.

Read-only: readOnlyHint is true.

Arguments​

NameTypeRequiredWhat it is
appstringyesPackage name on Android or bundle id on iOS.
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.

Ask whether an app is running​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_state",
"arguments": {
"app": "com.android.settings"
}
}
}

On an Android 15 emulator the answer's text was:

com.android.settings is in front