1. The most commonly used keys
// Return key , back
adb shell input keyevent 4
// Lock screen key / shutdown key
adb shell input keyevent 82
//Shake screen operation, slide from (50, 250) to (300, 400), and the sliding time (unit milliseconds) is 1000 ms
adb shell input swipe 50 250 ,300 400 1000
// This can be expanded. Assuming the distance from the origin to the target point is small enough, it will be considered a longtouch operation within a certain period of time.
//Click on the position of coordinate point x=50 y=250 on the screen.
adb shell input tap 50 250
//Input character abc
adb shell input text abc
2. KeyCode full explanation
Telephone related parts
Expressed in English
Chinese meaning
Number key value
KEYCODE_CALL
Dial key
5
KEYCODE_ENDCALL
Hang up key
6
KEYCODE_HOME
Button Home
3
KEYCODE_MENU
Menu keys
82
KEYCODE_BACK
Return key
4
KEYCODE_SEARCH
Search key
84
KEYCODE_CAMERA
Photo key
27
KEYCODE_FOCUS
Photo Focus Key
80
KEYCODE_POWER
Power key
26
KEYCODE_NOTIFICATION
Notification key
83
KEYCODE_MUTE
Microphone mute key
91
KEYCODE_VOLUME_MUTE
Speaker mute key
164
KEYCODE_VOLUME_UP
Volume increase key
24
KEYCODE_VOLUME_DOWN
Volume down key
25
Control related
Expressed in English
Chinese meaning
Number key value
KEYCODE_ENTER
Enter key
66
KEYCODE_ESCAPE
ESC
111
KEYCODE_DPAD_CENTER
Navigation key OK key
23
KEYCODE_DPAD_UP
Navigation key Up
19
KEYCODE_DPAD_DOWN
Navigation key Down
20
KEYCODE_DPAD_LEFT
Navigation key Left
21
KEYCODE_DPAD_RIGHT
Navigation keys Right
22
KEYCODE_MOVE_HOME
Move the cursor to the start key
122
KEYCODE_MOVE_END
Move the cursor to the end key
123
KEYCODE_PAGE_UP
Page Up key
92
KEYCODE_PAGE_DOWN
Page down key
93
KEYCODE_DEL
Backspace key
67
KEYCODE_FORWARD_DEL
Delete key
112
KEYCODE_INSERT
Insert key
124
KEYCODE_TAB
Tab key
61
KEYCODE_NUM_LOCK
Keyboard lock
143
KEYCODE_CAPS_LOCK
Caps lock key
115
KEYCODE_BREAK
Break/Pause key
121
KEYCODE_SCROLL_LOCK
Scroll lock key
116
KEYCODE_ZOOM_IN
Zoom key
168
KEYCODE_ZOOM_OUT
Zoom out key
169
Number letters
Expressed in English
Chinese meaning
Number key value
KEYCODE_0
Button '0'
7
KEYCODE_1
Button '1'
8
KEYCODE_2
Button '2'
9
KEYCODE_3
Button '3'
10
KEYCODE_4
Button '4'
11
KEYCODE_5
Button '5'
12
KEYCODE_6
Button '6'
13
KEYCODE_7
Button '7'
14
KEYCODE_8
Button '8'
15
KEYCODE_9
Button '9'
16
KEYCODE_A
Button 'A'
29
KEYCODE_B
Button 'B'
30
KEYCODE_C
Button 'C'
31
KEYCODE_D
Button 'D'
32
KEYCODE_E
Button 'E'
33
KEYCODE_F
Button 'F'
34
KEYCODE_G
Button 'G'
35
KEYCODE_H
Button 'H'
36
KEYCODE_I
Button 'I'
37
KEYCODE_J
Button 'J'
38
KEYCODE_K
Button 'K'
39
KEYCODE_L
Button 'L'
40
KEYCODE_M
Button 'M'
41
KEYCODE_N
Button 'N'
42
KEYCODE_O
Button 'O'
43
KEYCODE_P
Button 'P'
44
KEYCODE_Q
Key 'Q'
45
KEYCODE_R
Button 'R'
46
KEYCODE_S
Button 'S'
47
KEYCODE_T
Button 'T'
48
KEYCODE_U
Button 'U'
49
KEYCODE_V
Key 'V'
50
KEYCODE_W
Button 'W'
51
KEYCODE_X
Button 'X'
52
KEYCODE_Y
Button 'Y'
53
KEYCODE_Z
Button 'Z'
54
symbol
Key value representation
Chinese meaning
KEYCODE_PLUS
Button '+'
KEYCODE_MINUS
button'-'
KEYCODE_STAR
button'*'
KEYCODE_SLASH
button'/'
KEYCODE_EQUALS
Button '='
KEYCODE_AT
button'@'
KEYCODE_POUND
button'#'
KEYCODE_APOSTROPHE
Key ''' (single quotes)
KEYCODE_BACKSLASH
button''
KEYCODE_COMMA
button','
KEYCODE_PERIOD
button'.'
KEYCODE_LEFT_BRACKET
button'['
KEYCODE_RIGHT_BRACKET
button']'
KEYCODE_SEMICOLON
button';'
KEYCODE_GRAVE
Button '`'
KEYCODE_SPACE
Spacebar
Key combination
Key value representation
English meaning
KEYCODE_ALT_LEFT
Alt+Left
KEYCODE_ALT_RIGHT
Alt+Right
KEYCODE_CTRL_LEFT
Control+Left
KEYCODE_CTRL_RIGHT
Control+Right
KEYCODE_SHIFT_LEFT
Shift+Left
KEYCODE_SHIFT_RIGHT
Shift+Right
Keyboard
Key value representation
Chinese meaning
KEYCODE_NUMPAD_0
Keyboard key '0'
KEYCODE_NUMPAD_1
Keyboard key '1'
KEYCODE_NUMPAD_2
Keyboard key '2'
KEYCODE_NUMPAD_3
Keyboard key '3'
KEYCODE_NUMPAD_4
Keyboard key '4'
KEYCODE_NUMPAD_5
Keyboard key '5'
KEYCODE_NUMPAD_6
Keyboard key '6'
KEYCODE_NUMPAD_7
Keyboard key '7'
KEYCODE_NUMPAD_8
Keyboard key '8'
KEYCODE_NUMPAD_9
Keyboard key '9'
KEYCODE_NUMPAD_ADD
Keyboard key '+'
KEYCODE_NUMPAD_SUBTRACT
Keyboard keys '-'
KEYCODE_NUMPAD_MULTIPLY
Keyboard key '*'
KEYCODE_NUMPAD_DIVIDE
Keyboard keys '/'
KEYCODE_NUMPAD_EQUALS
Keyboard key '='
KEYCODE_NUMPAD_COMMA
Keyboard keys','
KEYCODE_NUMPAD_DOT
Keyboard keys '.'
KEYCODE_NUMPAD_LEFT_PAREN
Keyboard keys'('
KEYCODE_NUMPAD_RIGHT_PAREN
Keyboard keys ')'
KEYCODE_NUMPAD_ENTER
Keyboard key press Enter
Function keys
Key value representation
Chinese meaning
KEYCODE_F1
Button F1
KEYCODE_F2
Button F2
KEYCODE_F3
Button F3
KEYCODE_F4
Button F4
KEYCODE_F5
Button F5
KEYCODE_F6
Button F6
KEYCODE_F7
Button F7
KEYCODE_F8
Button F8
KEYCODE_F9
Button F9
KEYCODE_F10
Button F10
KEYCODE_F11
Button F11
KEYCODE_F12
Button F12
Multimedia related
Key value representation
Chinese meaning
KEYCODE_MEDIA_PLAY
Multimedia key playback
KEYCODE_MEDIA_STOP
Multimedia key Stop
KEYCODE_MEDIA_PAUSE
Multimedia key pause
KEYCODE_MEDIA_PLAY_PAUSE
Multimedia key Play/pause
KEYCODE_MEDIA_FAST_FORWARD
Multimedia key Fast forward
KEYCODE_MEDIA_REWIND
Multimedia keys Quick Retreat
KEYCODE_MEDIA_NEXT
Multimedia Key Next
KEYCODE_MEDIA_PREVIOUS
Multimedia keys Previous
KEYCODE_MEDIA_CLOSE
Multimedia key Close
KEYCODE_MEDIA_EJECT
Multimedia key pops up
KEYCODE_MEDIA_RECORD
Multimedia key recording
Close the handle first
Key value representation
Chinese meaning
KEYCODE_BUTTON_1
Universal Gamepad Button #1
KEYCODE_BUTTON_2
Universal Gamepad Button #2
KEYCODE_BUTTON_3
Universal Gamepad Button #3
KEYCODE_BUTTON_4
Universal Gamepad Button #4
KEYCODE_BUTTON_5
Universal Gamepad Button #5
KEYCODE_BUTTON_6
Universal Gamepad Button #6
KEYCODE_BUTTON_7
Universal Gamepad Button #7
KEYCODE_BUTTON_8
Universal Gamepad Button #8
KEYCODE_BUTTON_9
Universal Gamepad Button #9
KEYCODE_BUTTON_10
Universal Gamepad Button #10
KEYCODE_BUTTON_11
Universal Gamepad Button #11
KEYCODE_BUTTON_12
Universal Gamepad Button #12
KEYCODE_BUTTON_13
Universal Gamepad Button #13
KEYCODE_BUTTON_14
Universal Gamepad Button #14
KEYCODE_BUTTON_15
Universal Gamepad Button #15
KEYCODE_BUTTON_16
Universal Gamepad Button #16
KEYCODE_BUTTON_A
Gamepad Button A
KEYCODE_BUTTON_B
Gamepad Button B
KEYCODE_BUTTON_C
Gamepad Button C
KEYCODE_BUTTON_X
Gamepad Button X
KEYCODE_BUTTON_Y
Gamepad Button Y
KEYCODE_BUTTON_Z
Gamepad Button Z
KEYCODE_BUTTON_L1
Gamepad Button L1
KEYCODE_BUTTON_L2
Gamepad Button L2
KEYCODE_BUTTON_R1
Gamepad Button R1
KEYCODE_BUTTON_R2
Gamepad Button R2
KEYCODE_BUTTON_MODE
Gamepad Button Mode
KEYCODE_BUTTON_SELECT
Gamepad Button Select
KEYCODE_BUTTON_START
Gamepad Button Start
KEYCODE_BUTTON_THUMBL
Left Thumb Button
KEYCODE_BUTTON_THUMBR
Right Thumb Button
other
Key value representation
Chinese meaning
KEYCODE_NUM
Key Number modifier
KEYCODE_INFO
Key Info
KEYCODE_APP_SWITCH
Keys App switch
KEYCODE_BOOKMARK
Key Bookmark
KEYCODE_AVR_INPUT
Key A/V Receiver input
KEYCODE_AVR_POWER
Key A/V Receiver power
KEYCODE_CAPTIONS
Toggle captions
KEYCODE_CHANNEL_DOWN
Key Channel down
KEYCODE_CHANNEL_UP
Key Channel up
KEYCODE_CLEAR
Key Clear
Digital English quick check comparison table
0 --> "KEYCODE_UNKNOWN"
1 --> "KEYCODE_MENU"
2 --> "KEYCODE_SOFT_RIGHT"
3 --> "KEYCODE_HOME"
4 --> "KEYCODE_BACK"
5 --> "KEYCODE_CALL"
6 --> "KEYCODE_ENDCALL"
7 --> "KEYCODE_0"
8 --> "KEYCODE_1"
9 --> "KEYCODE_2"
10 --> "KEYCODE_3"
11 --> "KEYCODE_4"
12 --> "KEYCODE_5"
13 --> "KEYCODE_6"
14 --> "KEYCODE_7"
15 --> "KEYCODE_8"
16 --> "KEYCODE_9"
17 --> "KEYCODE_STAR"
18 --> "KEYCODE_POUND"
19 --> "KEYCODE_DPAD_UP"
20 --> "KEYCODE_DPAD_DOWN"
21 --> "KEYCODE_DPAD_LEFT"
22 --> "KEYCODE_DPAD_RIGHT"
23 --> "KEYCODE_DPAD_CENTER"
24 --> "KEYCODE_VOLUME_UP"
25 --> "KEYCODE_VOLUME_DOWN"
26 --> "KEYCODE_POWER"
27 --> "KEYCODE_CAMERA"
28 --> "KEYCODE_CLEAR"
29 --> "KEYCODE_A"
30 --> "KEYCODE_B"
31 --> "KEYCODE_C"
32 --> "KEYCODE_D"
33 --> "KEYCODE_E"
34 --> "KEYCODE_F"
35 --> "KEYCODE_G"
36 --> "KEYCODE_H"
37 --> "KEYCODE_I"
38 --> "KEYCODE_J"
39 --> "KEYCODE_K"
40 --> "KEYCODE_L"
41 --> "KEYCODE_M"
42 --> "KEYCODE_N"
43 --> "KEYCODE_O"
44 --> "KEYCODE_P"
45 --> "KEYCODE_Q"
46 --> "KEYCODE_R"
47 --> "KEYCODE_S"
48 --> "KEYCODE_T"
49 --> "KEYCODE_U"
50 --> "KEYCODE_V"
51 --> "KEYCODE_W"
52 --> "KEYCODE_X"
53 --> "KEYCODE_Y"
54 --> "KEYCODE_Z"
55 --> "KEYCODE_COMMA"
56 --> "KEYCODE_PERIOD"
57 --> "KEYCODE_ALT_LEFT"
58 --> "KEYCODE_ALT_RIGHT"
59 --> "KEYCODE_SHIFT_LEFT"
60 --> "KEYCODE_SHIFT_RIGHT"
61 --> "KEYCODE_TAB"
62 --> "KEYCODE_SPACE"
63 --> "KEYCODE_SYM"
64 --> "KEYCODE_EXPLORER"
65 --> "KEYCODE_ENVELOPE"
66 --> "KEYCODE_ENTER"
67 --> "KEYCODE_DEL"
68 --> "KEYCODE_GRAVE"
69 --> "KEYCODE_MINUS"
70 --> "KEYCODE_EQUALS"
71 --> "KEYCODE_LEFT_BRACKET"
72 --> "KEYCODE_RIGHT_BRACKET"
73 --> "KEYCODE_BACKSLASH"
74 --> "KEYCODE_SEMICOLON"
75 --> "KEYCODE_APOSTROPHE"
76 --> "KEYCODE_SLASH"
77 --> "KEYCODE_AT"
78 --> "KEYCODE_NUM"
79 --> "KEYCODE_HEADSETHOOK"
80 --> "KEYCODE_FOCUS"
81 --> "KEYCODE_PLUS"
82 --> "KEYCODE_MENU"
83 --> "KEYCODE_NOTIFICATION"
84 --> "KEYCODE_SEARCH"
85 --> "TAG_LAST_KEYCODE"