appium_mobile_press_key
Press Android navigation keys (BACK, HOME, APP_SWITCH) or iOS/tvOS physical buttons (HOME, volume, etc.) by specifying key or keycode. Supports long press for Android.
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 to target. If omitted, uses the active session. | |
| isLongPress | No | Android only. Whether to perform a long press. Defaults to false. |