Send key event directly to Android using adb shell command
ADB shell Input keyevent 7 # for key ' 0 ' adb shell input keyevent 8 # for key ' 1 ' adb shell input keyevent # For key ' A ' adb shell input keyevent # for key ' B '
Supported KeyCode
0--"keycode_unknown" 1--"Keycode_menu" 2--"keycode_soft_right" 3--"keycode_home" 4--"keycod E_back "5--" Keycode_call "6--" Keycode_endcall "7--" KEYCODE_0 "8--" keycode_1 "9--" keycode _2 "---" keycode_3 "--" keycode_4 "--" keycode_5 "--" keycode_6 "----" keycode_7 "15- "Keycode_8"--"keycode_9"--"Keycode_star" and "Keycode_pound" and "keycode_dpad_up" "--" keycode_dpad_down "--" keycode_dpad_left "--" keycode_dpad_right "--" keycode_dpad_ce NTER "--" keycode_volume_up "--" keycode_volume_down "--" keycode_power "and" Keycode_camer " A "Keycode_clear"--"keycode_a"--"keycode_b"--"Keycode_c" and "Keycode_d" ---"keycode_e"--"keycode_f"--"keycode_g"--"Keycode_h" and "Keycode_i"--&G T "Keycode_j"--> "Keycode_k"--"keycode_l"--"keycode_m"--"Keycode_n" and "Keycode_o" KeyCode _p "Keycode_q"--"keycode_r"--"keycode_s"--"keycode_t" and "Keycode_u" 50 --"Keycode_v"--"keycode_w"--"keycode_x"--"keycode_y" and "keycode_z"-- "Keycode_comma"--"keycode_period"--"keycode_alt_left"--"keycode_alt_right"--"keycod E_shift_left "--" keycode_shift_right "--" keycode_tab "--" keycode_space "and" Keycode_sym " "---" keycode_explorer "--" keycode_envelope "--" keycode_enter "--" Keycode_del "--> ; "Keycode_grave"--"Keycode_minus"--"keycode_equals"--"Keycode_left_bracket" and "Keyco" De_right_bracket "Keycode_backslash"--"Keycode_semicolon"--"keycode_apostrophe"-- "Keycode_slash" 77 --"Keycode_at"--"keycode_num"--"Keycode_headsethook" and "Keycode_focus" Bay----"KEYC Ode_plus "Keycode_menu"--"keycode_notification"--"keycode_search"--"tag_last_keycod E
Reprint Address: http://www.cnblogs.com/androidwsjisji/archive/2012/05/11/2496753.html
Android adb command Send KeyEvent