PRESS_DEVICE_BACK_BUTTON

The PRESS_DEVICE_BACK_BUTTON command simulates the physical/system back action on the device. This is essential for navigating through screens, closing modals, dismissing overlays, or returning to previous app states when no visible UI element exists for going back.

Syntax: PRESS_DEVICE_BACK_BUTTON

When to use:

  1. Navigating backward in Android screens where no “Back” icon or UI control is present

  2. Closing bottom sheets, popups, dialogs, or fullscreen overlays

  3. Exiting nested screens in complex flows

Last updated

Was this helpful?