extends:http://blog.csdn.net/huiguixian/article/details/11925389, http://blog.csdn.net/huiguixian/article/details/8550170
The simulation events are all implemented through the input command, first look at the use of the input command:
Usage:input ...
Input text <string>
Input KeyEvent <key code number or name>
Input tap <x> <y>
Input swipe <x1> <y1> <x2> <y2>
1. KeyEvent refers to the keycode of the Android counterpart, such as the Keycode=3,back key of the home key keycode=4.
Please refer to <android keycode for details > http://blog.csdn.net/huiguixian/article/details/8550170
Then it's easier to use it, like simulating the home button:
ADB shell Input KeyEvent 3
Please refer to the above article, according to the specific KeyCode editor.
2. In the case of tap, he simulates the touch screen event by simply giving the x and Y coordinates.
This x, y coordinate corresponds to the real screen resolution, so depending on the specific phone specific look, such as you want to click on the screen (x, y) = (250, 250) Position:
ADB shell input TAP 250 250
3. About swipe is the same as tap, except that he simulates a sliding event, giving the coordinates of the starting and ending points. For example from the screen (250, 250), to the screen (300, 300) i.e.
ADB shell input swipe 250 250 300 300
Keycode_unknown=0; Keycode_soft_left=1; Keycode_soft_right=2; Keycode_home=3; Keycode_back=4; Keycode_call=5; Keycode_endcall=6; Keycode_0=7; Keycode_1=8; Keycode_2=9; Keycode_3=10; Keycode_4=11; Keycode_5=12; Keycode_6=13; Keycode_7=14; Keycode_8=15; Keycode_9=16; Keycode_star=17; Keycode_pound=18; Keycode_dpad_up=19; Keycode_dpad_down=20; Keycode_dpad_left=21; Keycode_dpad_right=22; Keycode_dpad_center=23; Keycode_volume_up=24; Keycode_volume_down=25; Keycode_power=26; Keycode_camera=27; Keycode_clear=28; Keycode_a=29; Keycode_b=30; Keycode_c=31; Keycode_d=32; Keycode_e=33; Keycode_f=34; Keycode_g=35; Keycode_h=36; Keycode_i=37; Keycode_j=38; Keycode_k=39; Keycode_l=40; Keycode_m=41; Keycode_n=42; Keycode_o=43; Keycode_p=44; Keycode_q=45; Keycode_r=46; keycode_s=47; keycode_t=48; Keycode_u=49; Keycode_v=50; Keycode_w=51; Keycode_x=52; Keycode_y=53; Keycode_z=54; Keycode_comma=55; Keycode_period=56; Keycode_alt_left=57; Keycode_alt_right=58; Keycode_shift_left=59; Keycode_shift_right=60; Keycode_tab=61; Keycode_space=62; Keycode_sym=63; Keycode_explorer=64; Keycode_envelope=65; Keycode_enter=66; Keycode_del=67; Keycode_grave=68; Keycode_minus=69; Keycode_equals=70; Keycode_left_bracket=71; Keycode_right_bracket=72; Keycode_backslash=73; Keycode_semicolon=74; Keycode_apostrophe=75; Keycode_slash=76; Keycode_at=77; Keycode_num=78; Keycode_headsethook=79; Keycode_focus= 80;//*camera*focuskeycode_plus=81; Keycode_menu=82; Keycode_notification=83; Keycode_search=84; Keycode_media_play_pause=85; Keycode_media_stop=86; Keycode_media_next=87; Keycode_media_previous=88; Keycode_media_rewind=89; Keycode_media_fast_forward=90; Keycode_mute= 91;
Android adb analog swipe button click event