Usage of adb shell input

Source: Internet
Author: User

The input command was used in the gamma automated test of the LCD module recently, so we also learned about the use of the command. When you run the ADB shell and then enter input, the operation will output input using the following method:

Usage:input [<source>] <command> [<arg> ...]



The sources are:
Trackball
Joystick
Touchnavigation
Mouse
Keyboard
GamePad
Touchpad
Dpad
Stylus
Touchscreen


The commands and default sources are:
Text <string> (Default:touchscreen)
KeyEvent [--longpress] <key code number or name> ... (Default:keyboard)
Tap <x> <y> (Default:touchscreen)
Swipe <x1> <y1> <x2> <y2> [Duration (ms)] (Default:touchscreen)
Press (Default:trackball)

Roll <dx> <dy> (Default:trackball)

This is very simple, it does not explain!

First, KeyEvent events

I used to have two.

Swipe left screen adb shell input keyevent 21

Swipe right on the screen adb shell input keyevent 22

Other keyevent events and the corresponding num are 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"
Ten--"Keycode_3"
---"keycode_4"
---"keycode_5"
---"keycode_6"
---"keycode_7"
---"keycode_8"
---"keycode_9"
---"Keycode_star"
---"Keycode_pound"
--"keycode_dpad_up"
---"Keycode_dpad_down"
--"Keycode_dpad_left"
---"keycode_dpad_right"
--"Keycode_dpad_center"
---"keycode_volume_up"
---"Keycode_volume_down"
---"keycode_power"
---"Keycode_camera"
---"keycode_clear"
--"keycode_a"
---"Keycode_b"
---"Keycode_c"
---"keycode_d"
---"keycode_e"
---"Keycode_f"
--"Keycode_g"
---"Keycode_h"
---"keycode_i"
---"Keycode_j"
"Keycode_k"
---"keycode_l"
---"keycode_m"
--"Keycode_n"
---"keycode_o"
---"keycode_p"
---"keycode_q"
---"Keycode_r"
---"keycode_s"
---"keycode_t"
---"Keycode_u"
"Keycode_v"
Wuyi--"Keycode_w"
---"keycode_x"
---"keycode_y"
---"keycode_z"
---"Keycode_comma"
---"keycode_period"
---"Keycode_alt_left"
---"keycode_alt_right"
---"Keycode_shift_left"
"Keycode_shift_right"
---"Keycode_tab"
---"keycode_space"
---"Keycode_sym"
---"keycode_explorer"
"Keycode_envelope"
---"Keycode_enter"
---"Keycode_del"
---"Keycode_grave"
---"Keycode_minus"
---"keycode_equals"
---"Keycode_left_bracket"
---"Keycode_right_bracket"
---"Keycode_backslash"
---"Keycode_semicolon"
---"Keycode_apostrophe"
---"Keycode_slash"
---"keycode_at"
---"Keycode_num"
---"Keycode_headsethook"
---"Keycode_focus"
Bayi--"Keycode_plus"
----"Keycode_menu"
---"keycode_notification"
---"Keycode_search"
---"Tag_last_keycode"

Second, after the use of the re-write .....

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.