ACC Logo
ADBDebuggingSafe

adb shell input keyevent <keycode>

Simulate physical hardware key press

What It Does

Sends a simulated hardware key code event to the device window manager (e.g. Home, Back, Power, Volume).

Command Syntax
Terminal
$adb shell input keyevent <keycode_number_or_name>
Parameters & Placeholders Breakdown

This command syntax includes specific placeholder tokens. Below is an explanation of what each word represents and concrete real-world values to replace it with:

<keycode_number_or_name>Android Hardware Keycode Number

The numeric keycode constant representing a physical or navigation button event.

Real-world value:26 (Power) or 3 (Home) or 4 (Back) or 224 (Wakeup)
Command syntax: adb shell input keyevent 26
Keycode 26 toggles the power screen on/off; Keycode 3 returns to Home.
<keycode>Android Hardware Keycode Number

The numeric keycode constant representing a physical or navigation button event.

Real-world value:26 (Power) or 3 (Home) or 4 (Back) or 224 (Wakeup)
Command syntax: adb shell input keyevent 26
Keycode 26 toggles the power screen on/off; Keycode 3 returns to Home.
Usage Examples
$adb shell input keyevent 3
$adb shell input keyevent 4
$adb shell input keyevent 26
$adb shell input keyevent 82
Options & Flags
Flag / ParameterDescription
3KEYCODE_HOME
4KEYCODE_BACK
26KEYCODE_POWER
66KEYCODE_ENTER
82KEYCODE_MENU
Prerequisites & Requirements
  • Device connected
Related Commands
Found an error or missing flag for adb shell input keyevent <keycode>?

Submit a correction or request additional examples on GitHub.

Having issue? Contact @mkr_infinity

Direct technical assistance & ROM flashing troubleshooting by Mohammad Kaif Raja.

Contact @mkr_infinity