https://blog.csdn.net/zhangmeng1314/article/details/82699316
Such as the use adb shell input keyevent <keycode> command, different keycode can perform different functions, a complete list of keycode see KeyEvent, I think the interesting part of the quote is as follows:
Here are some uses of the command input examples.
Power key
commands:
adb shell input keyevent 26
Implementation of the results corresponding to the power button.
Menu key
command:
adb shell input keyevent 82
HOME key
commands:
adb shell input keyevent 3
Back key
command:
adb shell input keyevent 4
Volume Control
to increase the volume:
adb shell input keyevent 24
lower the volume:
adb shell input keyevent 25
Mute:
adb shell input keyevent 164
Media control
Play / Pause:
adb shell input keyevent 85
Stop play:
adb shell input keyevent 86
Play the next:
adb shell input keyevent 87
Play on one:
adb shell input keyevent 88
Resume:
adb shell input keyevent 126
Pause playback:
adb shell input keyevent 127
On / off-screen
can be switched on and off by the screens listed earlier analog power key, but if you want to explicitly turn on or off screen, it can use the following methods.
Light up the screen:
adb shell input keyevent 224
Off screen:
adb shell input keyevent 223
Slide to unlock
if no password lock screen is unlocked by sliding gestures, you can unlock by input swipe.
Command (model parameters Nexus 5, upward swipe gesture to unlock Example):
adb shell input swipe 300 1000 300 500
3001000300500 parameters represent the x-coordinate of the start point y coordinate of the starting point x coordinate of the end point of the end of the y coordinate.
Input text
when the focus is in a text box, the text may be inputted through the input command.
command:
adb shell input text hello
Hello now appear in the text box.