Skip to main content

AppState

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. These call app_state.

AppState​

func (d *Device) AppState(ctx context.Context, app string) (AppStatus, error)

AppState reports one app's state, for any app: not installed, not running, in the background or in front.

Examples​

Ask whether an app is running​

state, err := dev.AppState(ctx, "com.android.settings")
if err != nil {
return err
}
fmt.Println(state.State) // not_installed, not_running, background or foreground

The same call from the command line, mobium state com.android.settings, printed on an Android 15 emulator:

com.android.settings is in front