mobium lock
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Read whether the screen is locked, or lock and unlock it
With no argument, prints whether the screen is locked.
A state rather than a power-button press: power is a toggle, so asking for it twice leaves the device where it started and you cannot tell which way it went. Both directions are confirmed against the device.
A device with a PIN, pattern or password cannot be unlocked from outside, and mobium says so rather than reporting success.
Usage
mobium lock [lock | unlock] [flags]
Examples
Lock the screen
mobium lock lock
Unlock it
mobium lock unlock
More, from mobium lock --help
mobium lock # is it locked?
mobium lock lock
mobium lock unlock
No screenshot: a locked emulator's screen is off, so its screenshot is black.
The tool
lock calls app_lock; its arguments and what every client calls it are there.