appium_mobile_press_key
Simulates hardware and navigation button presses, such as BACK, HOME, volume, or directional keys, on Android, iOS, and tvOS devices to control app and system behavior during mobile automation.
Instructions
Press navigation keys (BACK, HOME, APP_SWITCH) on Android or physical buttons (HOME, volume, etc.) on iOS/tvOS.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Logical key/button to press. On Android: BACK, HOME, APP_SWITCH. On iOS/tvOS: HOME, VOLUME_UP, VOLUME_DOWN, UP, DOWN, LEFT, RIGHT, MENU, PLAY_PAUSE, SELECT. | |
| keyCode | No | Android keycode to press. If provided, takes precedence over key for Android. | |
| sessionId | No | Session ID; defaults to the active session. | |
| isLongPress | No | Android only. Whether to perform a long press. Defaults to false. |