adb_screen
Control Android screen state with wake, sleep, toggle, lock, or unlock actions. Unlock optionally enters PIN to dismiss keyguard on PIN-protected devices.
Instructions
Control screen state: wake, sleep, toggle, lock, or unlock. Lock and unlock verify actual keyguard state via dumpsys window. Unlock uses wm dismiss-keyguard (works for swipe keyguards); supply 'pin' to perform the full PIN entry sequence for PIN-protected devices: wakes screen, dismisses keyguard, swipes up to reveal keypad, types PIN, confirms with ENTER, and verifies the keyguard sleep token was released.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Screen action — one of: wake (power on + dismiss keyguard if no PIN), sleep (power off), toggle (flip current state), lock (force keyguard), unlock (dismiss keyguard, with PIN if supplied) | |
| pin | No | PIN/password to enter when unlock encounters an active keyguard (digits only for PIN, alphanumeric for password). Only used with action='unlock'. | |
| device | No | Device serial |