Skip to main content

Background

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

Send the app in front to the background for a number of seconds, then bring the same app back — resumed where it was, not relaunched — and confirm it is in front again. These call app_background.

Background​

func (d *Device) Background(ctx context.Context, seconds float64, app string) error

Background sends the app in front away for seconds and brings it back, resumed rather than relaunched, confirmed in front again. An empty app means the one in front. At most 180 seconds.

Examples​

Send the app away for five seconds, and bring it back​

// "" means the app in front.
if err := dev.Background(ctx, 5, ""); err != nil {
return err
}

The same call from the command line, mobium background 5, printed on an Android 15 emulator:

com.android.settings was in the background for 5s and is in front again