ADB command analog key input KeyCodeMay 18, 2017 14:57:32Hits: 1883
Example:
This command is equivalent to pressing the Backkey key of the device.
ADB shell Input KeyEvent 4
You can unlock the screen
ADB shell Input KeyEvent 82
Screen operation, the first four numbers are coordinate points, followed by the sliding time (in milliseconds)
ADB shell input Swipe 50 250 250 250 500
Click the position of the coordinate point x=50 y=250 on the screen.
ADB shell input Tap 50 250
Input character ABC
ADB shell input Text ABC
Each number corresponds to the KeyCode table as follows:
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"
KeyCode List
Phone key
Keycode_call Dialing Key 5
Keycode_endcall Hanging machine Key 6
Keycode_home Keys HOME 3
Keycode_menu Menu Key 82
Keycode_back Return key 4
Keycode_search Search Key 84
Keycode_camera Photo Key 27
Keycode_focus photo to zoom 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 Reduction key 25
Control keys
Keycode_enter Enter 66
Keycode_escape ESC key 111
Keycode_dpad_center navigation key OK key 23
KEYCODE_DPAD_UP Navigation key up 19
Keycode_dpad_down nav key down 20
Keycode_dpad_left Navigation key left 21
Keycode_dpad_right navigation key 22 to the right
Keycode_move_home cursor moves to start key 122
Keycode_move_end cursor moves 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 Keypad 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 magnification key 168
Keycode_zoom_out Zoom Out Key 169
Key combinations
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
Basic
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 key ' 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 button ' Q ' 45
Keycode_r Button ' R ' 46
keycode_s Button ' S ' 47
keycode_t button ' T ' 48
Keycode_u button ' U ' 49
Keycode_v button ' V ' 50
Keycode_w button ' W ' 51
keycode_x key ' X ' 52
keycode_y button ' Y ' 53
Keycode_z key ' Z ' 54
Symbol
Keycode_plus Button ' + '
Keycode_minus Button '-'
Keycode_star Button ' * '
Keycode_slash button '/'
Keycode_equals button ' = '
Keycode_at button ' @ '
Keycode_pound Button ' # '
Keycode_apostrophe button "' (single quote)
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 Space Key
Small keyboard
Keycode_numpad_0 keypad key ' 0 '
Keycode_numpad_1 keypad key ' 1 '
Keycode_numpad_2 keypad key ' 2 '
Keycode_numpad_3 keypad key ' 3 '
Keycode_numpad_4 keypad key ' 4 '
Keycode_numpad_5 keypad key ' 5 '
Keycode_numpad_6 keypad key ' 6 '
Keycode_numpad_7 keypad key ' 7 '
Keycode_numpad_8 keypad key ' 8 '
Keycode_numpad_9 keypad key ' 9 '
Keycode_numpad_add keypad key ' + '
Keycode_numpad_subtract keypad key '-'
keycode_numpad_multiply keypad Keys ' * '
Keycode_numpad_divide keypad button '/'
Keycode_numpad_equals keypad key ' = '
Keycode_numpad_comma keypad key ', '
Keycode_numpad_dot keypad key '. '
Keycode_numpad_left_paren keypad Keys ' ('
Keycode_numpad_right_paren keypad key ') '
Keycode_numpad_enter keypad Keys Enter
function keys
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 keys
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 Key Fast Rewind
Keycode_media_next Multimedia Key Next
Keycode_media_previous Multimedia key on a song
Keycode_media_close Multimedia Key off
Keycode_media_eject Multimedia Key Popup
Keycode_media_record Multimedia Key Recording
Handle button
Keycode_button_1 Universal Game handle Button # #
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 Game handle Button A
Keycode_button_b Game handle Button B
Keycode_button_c Game handle Button C
keycode_button_x Game handle Button X
Keycode_button_y Game handle Button Y
Keycode_button_z Game handle Button Z
KEYCODE_BUTTON_L1 Game handle Button L1
KEYCODE_BUTTON_L2 Game handle Button L2
KEYCODE_BUTTON_R1 Game handle Button R1
KEYCODE_BUTTON_R2 Game handle Button R2
Keycode_button_mode Game handle Button MODE
Keycode_button_select Game handle Button SELECT
Keycode_button_start Game handle Button START
Keycode_button_thumbl left Thumb BUTTON
Keycode_button_thumbr Right Thumb BUTTON
Unknown origin
Keycode_num
Key number modifier
Keycode_info
Key Info
Keycode_app_switch
Button App Switch
Keycode_bookmark
Key Bookmark
Keycode_avr_input
Key A/V Receiver input
Keycode_avr_power
Button A/V Receiver power
Keycode_captions
Key Toggle Captions
Keycode_channel_down
Key channel down
Keycode_channel_up
Key channel up
Keycode_clear
Button Clear
Keycode_dvr
Key DVR
Keycode_envelope
Key Envelope Special function
Keycode_explorer
Key Explorer Special function
Keycode_forward
Key forward
Keycode_forward_del
Key forward Delete
Keycode_function
Key function modifier
Keycode_guide
Key Guide
Keycode_headsethook
Button Headset Hook
Keycode_meta_left
Press the left Meta modifier
Keycode_meta_right
button right Meta modifier
Keycode_pictsymbols
Button picture Symbols modifier
Keycode_prog_blue
Key Blue "Programmable"
Keycode_prog_green
Button Green "programmable"
Keycode_prog_red
Key Red "programmable"
Keycode_prog_yellow
Key yellow "programmable"
Keycode_settings
Key settings
Keycode_soft_left
Press Soft left
Keycode_soft_right
Button Soft Right
Keycode_stb_input
Key Set-top-box Input
Keycode_stb_power
Key Set-top-box Power
Keycode_switch_charset
Button Switch Charset modifier
Keycode_sym
Key symbol modifier
Keycode_sysrq
Button System Request/print screen
Keycode_tv
Key TV
Keycode_tv_input
Key TV Input
Keycode_tv_power
Key TV Power
Keycode_window
Key window
Keycode_unknown
Unknown key
ADB command analog key input KeyCode