ADB Commands

  • General:
# List devices:
adb devices
# Tap on EditText:
adb shell input keyevent KEYCODE_TAB
# Input text into EditText:
adb shell input text <sometext>
  • Record emulator:
# Record:
adb shell screenrecord /sdcard/video.mp4
# Put it in desktop:
adb pull /sdcard/video.mp4 ~/Desktop/
  • Debug mode:
# Clear Debug mode:
adb shell am clear-debug-app
  • Accessibility:
# Start a11y service:
adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
# Stop a11y service:
adb shell am force-stop com.google.android.marvin.talkback
  • Dark mode:
# Enable:
adb shell "cmd uimode night yes"
# Disable:
adb shell "cmd uimode night no"
  • Touch on screen position
# Touch on specific screen position:
adb shell input touchscreen tap 700 1453
# Get touchscreen x and y position of areas you tap (0035 = x 0036 = y)
# returns a hex value than when converted to decimal, shows touched coordinates
adb shell getevent | grep -E -o '0035.{0,10}|0036.{0,10}'