Skip to content

Instantly share code, notes, and snippets.

@arjunv
Created December 2, 2018 00:01
Show Gist options
  • Save arjunv/2bbcca9a1a1c127749f8dcb6d36fb0bc to your computer and use it in GitHub Desktop.
Save arjunv/2bbcca9a1a1c127749f8dcb6d36fb0bc to your computer and use it in GitHub Desktop.
All Android Key Events for usage with adb shell
{
"key_events": {
"key_unknown": "adb shell input keyevent 0",
"key_soft_left": "adb shell input keyevent 1",
"key_soft_right": "adb shell input keyevent 2",
"key_home": "adb shell input keyevent 3",
"key_back": "adb shell input keyevent 4",
"key_call": "adb shell input keyevent 5",
"key_endcall": "adb shell input keyevent 6",
"key_0": "adb shell input keyevent 7",
"key_1": "adb shell input keyevent 8",
"key_2": "adb shell input keyevent 9",
"key_3": "adb shell input keyevent 10",
"key_4": "adb shell input keyevent 11",
"key_5": "adb shell input keyevent 12",
"key_6": "adb shell input keyevent 13",
"key_7": "adb shell input keyevent 14",
"key_8": "adb shell input keyevent 15",
"key_9": "adb shell input keyevent 16",
"key_star": "adb shell input keyevent 17",
"key_pound": "adb shell input keyevent 18",
"key_dpad_up": "adb shell input keyevent 19",
"key_dpad_down": "adb shell input keyevent 20",
"key_dpad_left": "adb shell input keyevent 21",
"key_dpad_right": "adb shell input keyevent 22",
"key_dpad_center": "adb shell input keyevent 23",
"key_volume_up": "adb shell input keyevent 24",
"key_volume_down": "adb shell input keyevent 25",
"key_power": "adb shell input keyevent 26",
"key_camera": "adb shell input keyevent 27",
"key_clear": "adb shell input keyevent 28",
"key_a": "adb shell input keyevent 29",
"key_b": "adb shell input keyevent 30",
"key_c": "adb shell input keyevent 31",
"key_d": "adb shell input keyevent 32",
"key_e": "adb shell input keyevent 33",
"key_f": "adb shell input keyevent 34",
"key_g": "adb shell input keyevent 35",
"key_h": "adb shell input keyevent 36",
"key_i": "adb shell input keyevent 37",
"key_j": "adb shell input keyevent 38",
"key_k": "adb shell input keyevent 39",
"key_l": "adb shell input keyevent 40",
"key_m": "adb shell input keyevent 41",
"key_n": "adb shell input keyevent 42",
"key_o": "adb shell input keyevent 43",
"key_p": "adb shell input keyevent 44",
"key_q": "adb shell input keyevent 45",
"key_r": "adb shell input keyevent 46",
"key_s": "adb shell input keyevent 47",
"key_t": "adb shell input keyevent 48",
"key_u": "adb shell input keyevent 49",
"key_v": "adb shell input keyevent 50",
"key_w": "adb shell input keyevent 51",
"key_x": "adb shell input keyevent 52",
"key_y": "adb shell input keyevent 53",
"key_z": "adb shell input keyevent 54",
"key_comma": "adb shell input keyevent 55",
"key_period": "adb shell input keyevent 56",
"key_alt_left": "adb shell input keyevent 57",
"key_alt_right": "adb shell input keyevent 58",
"key_shift_left": "adb shell input keyevent 59",
"key_shift_right": "adb shell input keyevent 60",
"key_tab": "adb shell input keyevent 61",
"key_space": "adb shell input keyevent 62",
"key_sym": "adb shell input keyevent 63",
"key_explorer": "adb shell input keyevent 64",
"key_envelope": "adb shell input keyevent 65",
"key_enter": "adb shell input keyevent 66",
"key_del": "adb shell input keyevent 67",
"key_grave": "adb shell input keyevent 68",
"key_minus": "adb shell input keyevent 69",
"key_equals": "adb shell input keyevent 70",
"key_left_bracket": "adb shell input keyevent 71",
"key_right_bracket": "adb shell input keyevent 72",
"key_backslash": "adb shell input keyevent 73",
"key_semicolon": "adb shell input keyevent 74",
"key_apostrophe": "adb shell input keyevent 75",
"key_slash": "adb shell input keyevent 76",
"key_at": "adb shell input keyevent 77",
"key_num": "adb shell input keyevent 78",
"key_headsethook": "adb shell input keyevent 79",
"key_focus": "adb shell input keyevent 80",
"key_plus": "adb shell input keyevent 81",
"key_menu": "adb shell input keyevent 82",
"key_notification": "adb shell input keyevent 83",
"key_search": "adb shell input keyevent 84",
"key_media_play_pause": "adb shell input keyevent 85",
"key_media_stop": "adb shell input keyevent 86",
"key_media_next": "adb shell input keyevent 87",
"key_media_previous": "adb shell input keyevent 88",
"key_media_rewind": "adb shell input keyevent 89",
"key_media_fast_forward": "adb shell input keyevent 90",
"key_mute": "adb shell input keyevent 91",
"key_page_up": "adb shell input keyevent 92",
"key_page_down": "adb shell input keyevent 93",
"key_pictsymbols": "adb shell input keyevent 94",
"key_switch_charset": "adb shell input keyevent 95",
"key_button_a": "adb shell input keyevent 96",
"key_button_b": "adb shell input keyevent 97",
"key_button_c": "adb shell input keyevent 98",
"key_button_x": "adb shell input keyevent 99",
"key_button_y": "adb shell input keyevent 100",
"key_button_z": "adb shell input keyevent 101",
"key_button_l1": "adb shell input keyevent 102",
"key_button_r1": "adb shell input keyevent 103",
"key_button_l2": "adb shell input keyevent 104",
"key_button_r2": "adb shell input keyevent 105",
"key_button_thumbl": "adb shell input keyevent 106",
"key_button_thumbr": "adb shell input keyevent 107",
"key_button_start": "adb shell input keyevent 108",
"key_button_select": "adb shell input keyevent 109",
"key_button_mode": "adb shell input keyevent 110",
"key_escape": "adb shell input keyevent 111",
"key_forward_del": "adb shell input keyevent 112",
"key_ctrl_left": "adb shell input keyevent 113",
"key_ctrl_right": "adb shell input keyevent 114",
"key_caps_lock": "adb shell input keyevent 115",
"key_scroll_lock": "adb shell input keyevent 116",
"key_meta_left": "adb shell input keyevent 117",
"key_meta_right": "adb shell input keyevent 118",
"key_function": "adb shell input keyevent 119",
"key_sysrq": "adb shell input keyevent 120",
"key_break": "adb shell input keyevent 121",
"key_move_home": "adb shell input keyevent 122",
"key_move_end": "adb shell input keyevent 123",
"key_insert": "adb shell input keyevent 124",
"key_forward": "adb shell input keyevent 125",
"key_media_play": "adb shell input keyevent 126",
"key_media_pause": "adb shell input keyevent 127",
"key_media_close": "adb shell input keyevent 128",
"key_media_eject": "adb shell input keyevent 129",
"key_media_record": "adb shell input keyevent 130",
"key_f1": "adb shell input keyevent 131",
"key_f2": "adb shell input keyevent 132",
"key_f3": "adb shell input keyevent 133",
"key_f4": "adb shell input keyevent 134",
"key_f5": "adb shell input keyevent 135",
"key_f6": "adb shell input keyevent 136",
"key_f7": "adb shell input keyevent 137",
"key_f8": "adb shell input keyevent 138",
"key_f9": "adb shell input keyevent 139",
"key_f10": "adb shell input keyevent 140",
"key_f11": "adb shell input keyevent 141",
"key_f12": "adb shell input keyevent 142",
"key_num_lock": "adb shell input keyevent 143",
"key_numpad_0": "adb shell input keyevent 144",
"key_numpad_1": "adb shell input keyevent 145",
"key_numpad_2": "adb shell input keyevent 146",
"key_numpad_3": "adb shell input keyevent 147",
"key_numpad_4": "adb shell input keyevent 148",
"key_numpad_5": "adb shell input keyevent 149",
"key_numpad_6": "adb shell input keyevent 150",
"key_numpad_7": "adb shell input keyevent 151",
"key_numpad_8": "adb shell input keyevent 152",
"key_numpad_9": "adb shell input keyevent 153",
"key_numpad_divide": "adb shell input keyevent 154",
"key_numpad_multiply": "adb shell input keyevent 155",
"key_numpad_subtract": "adb shell input keyevent 156",
"key_numpad_add": "adb shell input keyevent 157",
"key_numpad_dot": "adb shell input keyevent 158",
"key_numpad_comma": "adb shell input keyevent 159",
"key_numpad_enter": "adb shell input keyevent 160",
"key_numpad_equals": "adb shell input keyevent 161",
"key_numpad_left_paren": "adb shell input keyevent 162",
"key_numpad_right_paren": "adb shell input keyevent 163",
"key_volume_mute": "adb shell input keyevent 164",
"key_info": "adb shell input keyevent 165",
"key_channel_up": "adb shell input keyevent 166",
"key_channel_down": "adb shell input keyevent 167",
"key_zoom_in": "adb shell input keyevent 168",
"key_zoom_out": "adb shell input keyevent 169",
"key_tv": "adb shell input keyevent 170",
"key_window": "adb shell input keyevent 171",
"key_guide": "adb shell input keyevent 172",
"key_dvr": "adb shell input keyevent 173",
"key_bookmark": "adb shell input keyevent 174",
"key_captions": "adb shell input keyevent 175",
"key_settings": "adb shell input keyevent 176",
"key_tv_power": "adb shell input keyevent 177",
"key_tv_input": "adb shell input keyevent 178",
"key_stb_power": "adb shell input keyevent 179",
"key_stb_input": "adb shell input keyevent 180",
"key_avr_power": "adb shell input keyevent 181",
"key_avr_input": "adb shell input keyevent 182",
"key_prog_red": "adb shell input keyevent 183",
"key_prog_green": "adb shell input keyevent 184",
"key_prog_yellow": "adb shell input keyevent 185",
"key_prog_blue": "adb shell input keyevent 186",
"key_app_switch": "adb shell input keyevent 187",
"key_button_1": "adb shell input keyevent 188",
"key_button_2": "adb shell input keyevent 189",
"key_button_3": "adb shell input keyevent 190",
"key_button_4": "adb shell input keyevent 191",
"key_button_5": "adb shell input keyevent 192",
"key_button_6": "adb shell input keyevent 193",
"key_button_7": "adb shell input keyevent 194",
"key_button_8": "adb shell input keyevent 195",
"key_button_9": "adb shell input keyevent 196",
"key_button_10": "adb shell input keyevent 197",
"key_button_11": "adb shell input keyevent 198",
"key_button_12": "adb shell input keyevent 199",
"key_button_13": "adb shell input keyevent 200",
"key_button_14": "adb shell input keyevent 201",
"key_button_15": "adb shell input keyevent 202",
"key_button_16": "adb shell input keyevent 203",
"key_language_switch": "adb shell input keyevent 204",
"key_manner_mode": "adb shell input keyevent 205",
"key_3d_mode": "adb shell input keyevent 206",
"key_contacts": "adb shell input keyevent 207",
"key_calendar": "adb shell input keyevent 208",
"key_music": "adb shell input keyevent 209",
"key_calculator": "adb shell input keyevent 210",
"key_zenkaku_hankaku": "adb shell input keyevent 211",
"key_eisu": "adb shell input keyevent 212",
"key_muhenkan": "adb shell input keyevent 213",
"key_henkan": "adb shell input keyevent 214",
"key_katakana_hiragana": "adb shell input keyevent 215",
"key_yen": "adb shell input keyevent 216",
"key_ro": "adb shell input keyevent 217",
"key_kana": "adb shell input keyevent 218",
"key_assist": "adb shell input keyevent 219",
"key_brightness_down": "adb shell input keyevent 220",
"key_brightness_up": "adb shell input keyevent 221",
"key_media_audio_track": "adb shell input keyevent 222",
"key_sleep": "adb shell input keyevent 223",
"key_wakeup": "adb shell input keyevent 224",
"key_pairing": "adb shell input keyevent 225",
"key_media_top_menu": "adb shell input keyevent 226",
"key_11": "adb shell input keyevent 227",
"key_12": "adb shell input keyevent 228",
"key_last_channel": "adb shell input keyevent 229",
"key_tv_data_service": "adb shell input keyevent 230",
"key_voice_assist": "adb shell input keyevent 231",
"key_tv_radio_service": "adb shell input keyevent 232",
"key_tv_teletext": "adb shell input keyevent 233",
"key_tv_number_entry": "adb shell input keyevent 234",
"key_tv_terrestrial_analog": "adb shell input keyevent 235",
"key_tv_terrestrial_digital": "adb shell input keyevent 236",
"key_tv_satellite": "adb shell input keyevent 237",
"key_tv_satellite_bs": "adb shell input keyevent 238",
"key_tv_satellite_cs": "adb shell input keyevent 239",
"key_tv_satellite_service": "adb shell input keyevent 240",
"key_tv_network": "adb shell input keyevent 241",
"key_tv_antenna_cable": "adb shell input keyevent 242",
"key_tv_input_hdmi_1": "adb shell input keyevent 243",
"key_tv_input_hdmi_2": "adb shell input keyevent 244",
"key_tv_input_hdmi_3": "adb shell input keyevent 245",
"key_tv_input_hdmi_4": "adb shell input keyevent 246",
"key_tv_input_composite_1": "adb shell input keyevent 247",
"key_tv_input_composite_2": "adb shell input keyevent 248",
"key_tv_input_component_1": "adb shell input keyevent 249",
"key_tv_input_component_2": "adb shell input keyevent 250",
"key_tv_input_vga_1": "adb shell input keyevent 251",
"key_tv_audio_description": "adb shell input keyevent 252",
"key_tv_audio_description_mix_up": "adb shell input keyevent 253",
"key_tv_audio_description_mix_down": "adb shell input keyevent 254",
"key_tv_zoom_mode": "adb shell input keyevent 255",
"key_tv_contents_menu": "adb shell input keyevent 256",
"key_tv_media_context_menu": "adb shell input keyevent 257",
"key_tv_timer_programming": "adb shell input keyevent 258",
"key_help": "adb shell input keyevent 259",
"key_navigate_previous": "adb shell input keyevent 260",
"key_navigate_next": "adb shell input keyevent 261",
"key_navigate_in": "adb shell input keyevent 262",
"key_navigate_out": "adb shell input keyevent 263",
"key_stem_primary": "adb shell input keyevent 264",
"key_stem_1": "adb shell input keyevent 265",
"key_stem_2": "adb shell input keyevent 266",
"key_stem_3": "adb shell input keyevent 267",
"key_dpad_up_left": "adb shell input keyevent 268",
"key_dpad_down_left": "adb shell input keyevent 269",
"key_dpad_up_right": "adb shell input keyevent 270",
"key_dpad_down_right": "adb shell input keyevent 271",
"key_media_skip_forward": "adb shell input keyevent 272",
"key_media_skip_backward": "adb shell input keyevent 273",
"key_media_step_forward": "adb shell input keyevent 274",
"key_media_step_backward": "adb shell input keyevent 275",
"key_soft_sleep": "adb shell input keyevent 276",
"key_cut": "adb shell input keyevent 277",
"key_copy": "adb shell input keyevent 278",
"key_paste": "adb shell input keyevent 279",
"key_system_navigation_up": "adb shell input keyevent 280",
"key_system_navigation_down": "adb shell input keyevent 281",
"key_system_navigation_left": "adb shell input keyevent 282",
"key_system_navigation_right": "adb shell input keyevent 283",
"key_all_apps": "adb shell input keyevent 284",
"key_refresh": "adb shell input keyevent 285"
}
}
@PPPDUD
Copy link

PPPDUD commented Aug 16, 2023

Is it safe for me to set the battery percentage with adb shell dumpsys battery set level 200 on my main Android device and then run adb shell dumpsys battery reset on it? Could there be negative effects on the battery? Would the device begin to experience a brownout with no way of telling the true percentage or recovering?

@harshiltestgrid
Copy link

harshiltestgrid commented Nov 25, 2023

    "key_zoom_in": "adb shell input keyevent 168",
    "key_zoom_out": "adb shell input keyevent 169",
    
    Not working! why?

Give me alternative

@tomneto
Copy link

tomneto commented Dec 21, 2023



def adb(command):
    os.system(f"adb shell {command}")


class KeyMap:
    zero = "input keyevent 0"
    soft_left = "input keyevent 1"
    soft_right = "input keyevent 2"
    home = "input keyevent 3"
    back = "input keyevent 4"
    call = "input keyevent 5"
    endcall = "input keyevent 6"
    zer0 = "input keyevent 7"
    one = "input keyevent 8"
    two = "input keyevent 9"
    three = "input keyevent 10"
    four = "input keyevent 11"
    five = "input keyevent 12"
    six = "input keyevent 13"
    seven = "input keyevent 14"
    eight = "input keyevent 15"
    nine = "input keyevent 16"
    star = "input keyevent 17"
    pound = "input keyevent 18"
    dpad_up = "input keyevent 19"
    dpad_down = "input keyevent 20"
    dpad_left = "input keyevent 21"
    dpad_right = "input keyevent 22"
    dpad_center = "input keyevent 23"
    volume_up = "input keyevent 24"
    volume_down = "input keyevent 25"
    power = "input keyevent 26"
    camera = "input keyevent 27"
    clear = "input keyevent 28"
    a = "input keyevent 29"
    b = "input keyevent 30"
    c = "input keyevent 31"
    d = "input keyevent 32"
    e = "input keyevent 33"
    f = "input keyevent 34"
    g = "input keyevent 35"
    h = "input keyevent 36"
    i = "input keyevent 37"
    j = "input keyevent 38"
    k = "input keyevent 39"
    l = "input keyevent 40"
    m = "input keyevent 41"
    n = "input keyevent 42"
    o = "input keyevent 43"
    p = "input keyevent 44"
    q = "input keyevent 45"
    r = "input keyevent 46"
    s = "input keyevent 47"
    t = "input keyevent 48"
    u = "input keyevent 49"
    v = "input keyevent 50"
    w = "input keyevent 51"
    x = "input keyevent 52"
    y = "input keyevent 53"
    z = "input keyevent 54"
    comma = "input keyevent 55"
    period = "input keyevent 56"
    alt_left = "input keyevent 57"
    alt_right = "input keyevent 58"
    shift_left = "input keyevent 59"
    shift_right = "input keyevent 60"
    tab = "input keyevent 61"
    space = "input keyevent 62"
    sym = "input keyevent 63"
    explorer = "input keyevent 64"
    envelope = "input keyevent 65"
    enter = "input keyevent 66"
    delete = "input keyevent 67"
    grave = "input keyevent 68"
    minus = "input keyevent 69"
    equals = "input keyevent 70"
    left_bracket = "input keyevent 71"
    right_bracket = "input keyevent 72"
    backslash = "input keyevent 73"
    semicolon = "input keyevent 74"
    apostrophe = "input keyevent 75"
    slash = "input keyevent 76"
    at = "input keyevent 77"
    num = "input keyevent 78"
    headsethook = "input keyevent 79"
    focus = "input keyevent 80"
    plus = "input keyevent 81"
    menu = "input keyevent 82"
    notification = "input keyevent 83"
    search = "input keyevent 84"
    media_play_pause = "input keyevent 85"
    media_stop = "input keyevent 86"
    media_next = "input keyevent 87"
    media_previous = "input keyevent 88"
    media_rewind = "input keyevent 89"
    media_fast_forward = "input keyevent 90"
    mute = "input keyevent 91"
    page_up = "input keyevent 92"
    page_down = "input keyevent 93"
    pictsymbols = "input keyevent 94"
    switch_charset = "input keyevent 95"
    button_a = "input keyevent 96"
    button_b = "input keyevent 97"
    button_c = "input keyevent 98"
    button_x = "input keyevent 99"
    button_y = "input keyevent 100"
    button_z = "input keyevent 101"
    button_l1 = "input keyevent 102"
    button_r1 = "input keyevent 103"
    button_l2 = "input keyevent 104"
    button_r2 = "input keyevent 105"
    button_thumbl = "input keyevent 106"
    button_thumbr = "input keyevent 107"
    button_start = "input keyevent 108"
    button_select = "input keyevent 109"
    button_mode = "input keyevent 110"
    escape = "input keyevent 111"
    forward_del = "input keyevent 112"
    ctrl_left = "input keyevent 113"
    ctrl_right = "input keyevent 114"
    caps_lock = "input keyevent 115"
    scroll_lock = "input keyevent 116"
    meta_left = "input keyevent 117"
    meta_right = "input keyevent 118"
    function = "input keyevent 119"
    sys_rq = "input keyevent 120"
    pause_break = "input keyevent 121"
    move_home = "input keyevent 122"
    move_end = "input keyevent 123"
    insert = "input keyevent 124"
    forward = "input keyevent 125"
    media_play = "input keyevent 126"
    media_pause = "input keyevent 127"
    media_close = "input keyevent 128"
    media_eject = "input keyevent 129"
    media_record = "input keyevent 130"
    f1 = "input keyevent 131"
    f2 = "input keyevent 132"
    f3 = "input keyevent 133"
    f4 = "input keyevent 134"
    f5 = "input keyevent 135"
    f6 = "input keyevent 136"
    f7 = "input keyevent 137"
    f8 = "input keyevent 138"
    f9 = "input keyevent 139"
    f10 = "input keyevent 140"
    f11 = "input keyevent 141"
    f12 = "input keyevent 142"
    num_lock = "input keyevent 143"
    numpad_0 = "input keyevent 144"
    numpad_1 = "input keyevent 145"
    numpad_2 = "input keyevent 146"
    numpad_3 = "input keyevent 147"
    numpad_4 = "input keyevent 148"
    numpad_5 = "input keyevent 149"
    numpad_6 = "input keyevent 150"
    numpad_7 = "input keyevent 151"
    numpad_8 = "input keyevent 152"
    numpad_9 = "input keyevent 153"
    numpad_divide = "input keyevent 154"
    numpad_multiply = "input keyevent 155"
    numpad_subtract = "input keyevent 156"
    numpad_add = "input keyevent 157"
    numpad_dot = "input keyevent 158"
    numpad_comma = "input keyevent 159"
    numpad_enter = "input keyevent 160"
    numpad_equals = "input keyevent 161"
    numpad_left_paren = "input keyevent 162"
    numpad_right_paren = "input keyevent 163"
    volume_mute = "input keyevent 164"
    info = "input keyevent 165"
    channel_up = "input keyevent 166"
    channel_down = "input keyevent 167"
    zoom_in = "input keyevent 168"
    zoom_out = "input keyevent 169"
    tv = "input keyevent 170"
    window = "input keyevent 171"
    guide = "input keyevent 172"
    dvr = "input keyevent 173"
    bookmark = "input keyevent 174"
    captions = "input keyevent 175"
    settings = "input keyevent 176"
    tv_power = "input keyevent 177"
    tv_input = "input keyevent 178"
    stb_power = "input keyevent 179"
    stb_input = "input keyevent 180"
    avr_power = "input keyevent 181"
    avr_input = "input keyevent 182"
    prog_red = "input keyevent 183"
    prog_green = "input keyevent 184"
    prog_yellow = "input keyevent 185"
    prog_blue = "input keyevent 186"
    app_switch = "input keyevent 187"
    button_1 = "input keyevent 188"
    button_2 = "input keyevent 189"
    button_3 = "input keyevent 190"
    button_4 = "input keyevent 191"
    button_5 = "input keyevent 192"
    button_6 = "input keyevent 193"
    button_7 = "input keyevent 194"
    button_8 = "input keyevent 195"
    button_9 = "input keyevent 196"
    button_10 = "input keyevent 197"
    button_11 = "input keyevent 198"
    button_12 = "input keyevent 199"
    button_13 = "input keyevent 200"
    button_14 = "input keyevent 201"
    button_15 = "input keyevent 202"
    button_16 = "input keyevent 203"
    language_switch = "input keyevent 204"
    manner_mode = "input keyevent 205"
    three_dimensional_mode = "input keyevent 206"
    contacts = "input keyevent 207"
    calendar = "input keyevent 208"
    music = "input keyevent 209"
    calculator = "input keyevent 210"
    zenkaku_hankaku = "input keyevent 211"
    eisu = "input keyevent 212"
    muhenkan = "input keyevent 213"
    henkan = "input keyevent 214"
    katakana_hiragana = "input keyevent 215"
    yen = "input keyevent 216"
    ro = "input keyevent 217"
    kana = "input keyevent 218"
    assist = "input keyevent 219"
    brightness_down = "input keyevent 220"
    brightness_up = "input keyevent 221"
    media_audio_track = "input keyevent 222"
    sleep = "input keyevent 223"
    wakeup = "input keyevent 224"
    pairing = "input keyevent 225"
    media_top_menu = "input keyevent 226"
    f11 = "input keyevent 227"
    f12 = "input keyevent 228"
    last_channel = "input keyevent 229"
    tv_data_service = "input keyevent 230"
    voice_assist = "input keyevent 231"
    tv_radio_service = "input keyevent 232"
    tv_teletext = "input keyevent 233"
    tv_number_entry = "input keyevent 234"
    tv_terrestrial_analog = "input keyevent 235"
    tv_terrestrial_digital = "input keyevent 236"
    tv_satellite = "input keyevent 237"
    tv_satellite_bs = "input keyevent 238"
    tv_satellite_cs = "input keyevent 239"
    tv_satellite_service = "input keyevent 240"
    tv_network = "input keyevent 241"
    tv_antenna_cable = "input keyevent 242"
    tv_input_hdmi_1 = "input keyevent 243"
    tv_input_hdmi_2 = "input keyevent 244"
    tv_input_hdmi_3 = "input keyevent 245"
    tv_input_hdmi_4 = "input keyevent 246"
    tv_input_composite_1 = "input keyevent 247"
    tv_input_composite_2 = "input keyevent 248"
    tv_input_component_1 = "input keyevent 249"
    tv_input_component_2 = "input keyevent 250"
    tv_input_vga_1 = "input keyevent 251"
    tv_audio_description = "input keyevent 252"
    tv_audio_description_mix_up = "input keyevent 253"
    tv_audio_description_mix_down = "input keyevent 254"
    tv_zoom_mode = "input keyevent 255"
    tv_contents_menu = "input keyevent 256"
    tv_media_context_menu = "input keyevent 257"
    tv_timer_programming = "input keyevent 258"
    help = "input keyevent 259"
    navigate_previous = "input keyevent 260"
    navigate_next = "input keyevent 261"
    navigate_in = "input keyevent 262"
    navigate_out = "input keyevent 263"
    stem_primary = "input keyevent 264"
    stem_1 = "input keyevent 265"
    stem_2 = "input keyevent 266"
    stem_3 = "input keyevent 267"
    dpad_up_left = "input keyevent 268"
    dpad_down_left = "input keyevent 269"
    dpad_up_right = "input keyevent 270"
    dpad_down_right = "input keyevent 271"
    media_skip_forward = "input keyevent 272"
    media_skip_backward = "input keyevent 273"
    media_step_forward = "input keyevent 274"
    media_step_backward = "input keyevent 275"
    soft_sleep = "input keyevent 276"
    cut = "input keyevent 277"
    copy = "input keyevent 278"
    paste = "input keyevent 279"
    system_navigation_up = "input keyevent 280"
    system_navigation_down = "input keyevent 281"
    system_navigation_left = "input keyevent 282"
    system_navigation_right = "input keyevent 283"
    all_apps = "input keyevent 284"
    refresh = "input keyevent 285"

@pisabird
Copy link

Thank you so much @arjunv

@kingsleyesisi
Copy link

Is there a way I can connect ADB over the internet?
Or access an android phone over the network with the terminal?

@maqtay
Copy link

maqtay commented Jul 30, 2024

Hi, which command here is triggered after the hand-held barcode reader reads it?

@pjg101
Copy link

pjg101 commented Aug 2, 2024

Is there a way I can connect ADB over the internet? Or access an android phone over the network with the terminal?

Yes, you will need to:

  • Install adb on your terminal's platform/OS.
  • Usually turn on 'developer options'. This is device dependent but it's usually 7 taps in about->build ID in options on your device. You may have to do some digging for your android device.
  • And you may have to switch the 'Android Debug Bridge' (adb) on as well after activating developer options usually located in the developer options sub-menu that appears once you have this switched on (see step 2).
  • Then connect to your device from your terminal/powershell etc. "adb connect <ip address>"

@kingsleyesisi
Copy link

Is there a way I can connect ADB over the internet? Or access an android phone over the network with the terminal?

Yes, you will need to:

  • Install adb on your terminal's platform/OS.
  • Usually turn on 'developer options'. This is device dependent but it's usually 7 taps in about->build ID in options on your device. You may have to do some digging for your android device.
  • And you may have to switch the 'Android Debug Bridge' (adb) on as well after activating developer options usually located in the developer options sub-menu that appears once you have this switched on (see step 2).
  • Then connect to your device from your terminal/powershell etc. "adb connect "

But without the specific port open it won't work

How do I open it remotely

@heo001997
Copy link

Thank to this ADB map, I created an alternative that map char & key into keyevent: https://gist.github.com/heo001997/8df06a6d7f0f31d47b36c1fc5870797b

You can use this directly as a map function, enjoy!

Sample:

{
  "char_events": {
    "0": "adb shell input keyevent 7",
    "1": "adb shell input keyevent 8",
    "2": "adb shell input keyevent 9",
    ...
    "a": "adb shell input keyevent 29",
    "b": "adb shell input keyevent 30",
    "c": "adb shell input keyevent 31",
    ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment