1 input in terminal: adb shell
2 Enter input to get the following information:
Usage:input [<source>] <command> [<arg> ...]
Source: Event Sources
Command: Commands
ARG: Parameter
The sources are:
Trackball//Trackball, as if HTC Hero3 has this thing
Joystick//Joystick
Touchnavigation
Mouse
Keyboard//keyboard
GamePad
Touchpad
Dpad
Stylus
Touchscreen//Touch screen
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)
Text: Literal input, parameter is a string, use two single quotation marks to cause
In the text input box to get focus, the ADB shell input eg:input text ' Hello World ', observe the effect
KeyEvent: Keyboard event, the number or name of the parameter that corresponds to the keyboard character
Used to perform various keyboard events, such as returning, tapping a button on the keyboard, etc., eg:input keyevent 3 = = Click the Home button
Tap: User Click event, parameter is absolute screen coordinates
Analog Click action: Eg:input tap + + click on the screen with a coordinate value of (100,100) point
Swipe: Slide event with the coordinates of the sliding start point and end point,
Eg:input Swipe (100,100) sliding from point Y1 to Y2 (200,200), you can also specify the time to slide, in MS
The command can also simulate long press events eg: adb shell input touchscreen swipe 187 187 (170,187) 2s time
Press is not quite clear, after use is similar to switching focus
Roll has not been used, there is no introduction
ADB simulates human-computer interaction events