Adb App Control Extended Key <2026 Release>

Commentary on "ADB App Control Extended Key"

✅ Reliable Every Time


3. Turn Screen Off and On Remotely

# Screen off
adb shell input keyevent 26

Taking It Further: Scripting Extended Keys

Combine extended keys with adb shell am and adb shell dumpsys for powerful automation.

Example: Create a "Smart Remote" Bash Script

#!/bin/bash
case "$1" in
  play)
    adb shell input keyevent 85 ;;
  next)
    adb shell input keyevent 87 ;;
  prev)
    adb shell input keyevent 88 ;;
  volup)
    adb shell input keyevent 24 ;;
  voldown)
    adb shell input keyevent 25 ;;
  torch)
    adb shell input keyevent 212 ;;
  power)
    adb shell input keyevent 26 ;;
  *)
    echo "Usage: $0 voldown" ;;
esac

Save as remote.sh and run:

./remote.sh next

Revoke camera and microphone permissions

pm revoke $PACKAGE android.permission.CAMERA && pm revoke $PACKAGE android.permission.RECORD_AUDIO && adb app control extended key

2. The appops Command – The Real Extended Control

appops is the unsung hero of ADB app control. It manages low-level app operations. This is where the "extended key" truly shines.

Syntax: adb shell appops set <package> <op> <mode>

Example Extended Keys with appops:

  • RUN_IN_BACKGROUND – Control whether an app can run background services.
  • WAKE_LOCK – Prevent apps from keeping the device awake.
  • GET_USAGE_STATS – Grant/revoke usage access without navigating settings.

Real-world command:

adb shell appops set com.facebook.katana RUN_IN_BACKGROUND ignore

This command (using the extended key RUN_IN_BACKGROUND and mode ignore) forces Facebook to stop background processes without uninstalling or disabling the app.

2. Standard Key Events (Navigation & Media)

These are the most common events used to control apps and the system UI. You can use these to navigate an app without touching the screen. Commentary on "ADB App Control Extended Key" ✅

| Key Name | Key Code | Function | | :--- | :--- | :--- | | KEYCODE_HOME | 3 | Go to Home screen. | | KEYCODE_BACK | 4 | Go back one step. | | KEYCODE_MENU | 82 | Open soft menu options (older apps). | | KEYCODE_APP_SWITCH | 187 | Open Recent Apps list. | | KEYCODE_POWER | 26 | Wake/Sleep device. | | KEYCODE_ENTER | 66 | Confirm/Select. | | KEYCODE_TAB | 61 | Move to next focusable element. | | KEYCODE_ESCAPE | 111 | Cancel dialogs / Close popups. |

Example Usage:

# Go back to the previous screen
adb shell input keyevent 4
# Go to the Home screen
adb shell input keyevent KEYCODE_HOME

1. The Core Command: input

The primary method for sending key events is the adb shell input command. The syntax generally follows this structure: Power, Volume, Home, Back, App Switch

adb shell input <source> <command> [arguments]

For key events, the specific command is keyevent.

×

Report Game