Forrest logo
back to the input tool

input:tldr:2a672

input: Send an event code for a single character to an Android device.
$ input keyevent ${event_code}
try on your machine

The command "input keyevent ${event_code}" is a command used in Android's ADB (Android Debug Bridge) tool to simulate key events on an Android device.

Here's an explanation of the different parts of the command:

  • "input": It's the ADB command used to simulate input events on Android devices.

  • "keyevent": It's a sub-command of "input" specifically used to simulate key events, such as pressing a physical or virtual key on the device.

  • "${event_code}": It's a placeholder for the event code that represents the specific key event to be simulated. The event codes correspond to different keys on the Android device, like volume up/down, power, home, back, or any other keycodes available in the Android KeyEvent class. You would replace "${event_code}" with the specific keycode you want to simulate.

For example, if you want to simulate the event of pressing the back button on an Android device, you would use the command "input keyevent 4", where '4' is the event code for the back key.

Overall, this command allows developers or users to simulate key events on Android devices programmatically, facilitating various automation or testing tasks.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the input tool