All ADB Command - shivamprasad1001/adb-wireless-toolkit GitHub Wiki

Keyboard & Text Input

Action Command
Type text adb shell input text 'Your_Text_Here'
Send Enter adb shell input keyevent 66
Send Space adb shell input keyevent 62
Backspace/Delete adb shell input keyevent 67
Clear field (trick) adb shell input keyevent 123 && adb shell input keyevent --longpress 67

KeyEvent Codes:

Key Code Description
KEYCODE_UNKNOWN 0 Unknown key
KEYCODE_MENU 1 Menu
KEYCODE_SOFT_RIGHT 2 Soft right
KEYCODE_HOME 3 Home button
KEYCODE_BACK 4 Back button
KEYCODE_CALL 5 Call button
KEYCODE_ENDCALL 6 End call
KEYCODE_0 to KEYCODE_9 7 to 16 Numeric keys 0–9
KEYCODE_STAR 17 * (star)
KEYCODE_POUND 18 # (pound)
KEYCODE_DPAD_UP 19 D-Pad up
KEYCODE_DPAD_DOWN 20 D-Pad down
KEYCODE_DPAD_LEFT 21 D-Pad left
KEYCODE_DPAD_RIGHT 22 D-Pad right
KEYCODE_DPAD_CENTER 23 D-Pad center/select
KEYCODE_VOLUME_UP 24 Volume up
KEYCODE_VOLUME_DOWN 25 Volume down
KEYCODE_POWER 26 Power (lock screen)
KEYCODE_CAMERA 27 Camera button
KEYCODE_CLEAR 28 Clear key
KEYCODE_A to KEYCODE_Z 29 to 54 Alphabet keys A–Z
KEYCODE_COMMA 55 ,
KEYCODE_PERIOD 56 .
KEYCODE_ALT_LEFT 57 Left Alt
KEYCODE_ALT_RIGHT 58 Right Alt
KEYCODE_SHIFT_LEFT 59 Left Shift
KEYCODE_SHIFT_RIGHT 60 Right Shift
KEYCODE_TAB 61 Tab
KEYCODE_SPACE 62 Spacebar
KEYCODE_SYM 63 Symbol modifier
KEYCODE_EXPLORER 64 Explorer
KEYCODE_ENVELOPE 65 Email app
KEYCODE_ENTER 66 Enter / Return
KEYCODE_DEL 67 Delete / Backspace
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 Number modifier
KEYCODE_HEADSETHOOK 79 Headset hook
KEYCODE_FOCUS 80 Camera focus
KEYCODE_PLUS 81 +
KEYCODE_MENU 82 Menu
KEYCODE_NOTIFICATION 83 Notifications
KEYCODE_SEARCH 84 Search
KEYCODE_MEDIA_PLAY_PAUSE 85 Play/Pause
KEYCODE_MEDIA_STOP 86 Stop
KEYCODE_MEDIA_NEXT 87 Next track
KEYCODE_MEDIA_PREVIOUS 88 Previous track
KEYCODE_MEDIA_REWIND 89 Rewind
KEYCODE_MEDIA_FAST_FORWARD 90 Fast forward
KEYCODE_MUTE 91 Mute
KEYCODE_PAGE_UP 92 Page Up
KEYCODE_PAGE_DOWN 93 Page Down
KEYCODE_PICTSYMBOLS 94 Symbol keyboard toggle
KEYCODE_SWITCH_CHARSET 95 Character set switch
KEYCODE_BUTTON_A to KEYCODE_BUTTON_Z 96+ Gamepad buttons
KEYCODE_ESCAPE 111 Escape
KEYCODE_FORWARD_DEL 112 Forward delete
KEYCODE_CTRL_LEFT 113 Left Ctrl
KEYCODE_CTRL_RIGHT 114 Right Ctrl
KEYCODE_CAPS_LOCK 115 Caps Lock
KEYCODE_SCROLL_LOCK 116 Scroll Lock
KEYCODE_META_LEFT 117 Left Meta key
KEYCODE_META_RIGHT 118 Right Meta key
KEYCODE_FUNCTION 119 Function modifier
KEYCODE_SYSRQ 120 SysRq
KEYCODE_BREAK 121 Break/Pause
KEYCODE_MOVE_HOME 122 Move to start of line
KEYCODE_MOVE_END 123 Move to end of line
KEYCODE_INSERT 124 Insert
KEYCODE_FORWARD 125 Forward
KEYCODE_MEDIA_PLAY 126 Play media
KEYCODE_MEDIA_PAUSE 127 Pause media
KEYCODE_MEDIA_CLOSE 128 Close media
KEYCODE_MEDIA_EJECT 129 Eject media
KEYCODE_MEDIA_RECORD 130 Record
KEYCODE_F1 to F12 131 to 142 Function keys
KEYCODE_NUM_LOCK 143 Num Lock
KEYCODE_CALCULATOR 210 Calculator
KEYCODE_CALENDAR 208 Calendar
KEYCODE_CONTACTS 207 Contacts
KEYCODE_MUSIC 209 Music
KEYCODE_ASSIST 219 Assistant
KEYCODE_SLEEP 223 Sleep (turn screen off)
KEYCODE_WAKEUP 224 Wake up (turn screen on)
KEYCODE_APP_SWITCH 187 App Switcher

Touch & Gestures

Action Command
Tap adb shell input tap X Y
Swipe adb shell input swipe X1 Y1 X2 Y2
Long press adb shell input swipe X Y X Y 1500
Drag (slow swipe) adb shell input swipe 100 500 700 500 1000

Screen & Display

Action Command
πŸ“Έ Take Screenshot adb exec-out screencap -p > screenshot.png
πŸŽ₯ Record Screen (default 180s) adb shell screenrecord /sdcard/demo.mp4
⏱️ Record Screen for X Seconds adb shell screenrecord --time-limit 10 /sdcard/clip.mp4
πŸ’Ύ Pull Recorded Video to PC adb pull /sdcard/clip.mp4
πŸ”„ Rotate Screen (Portrait) adb shell settings put system user_rotation 0
πŸ”„ Rotate Screen (Landscape) adb shell settings put system user_rotation 1
πŸŒ“ Set Brightness (0-255) adb shell settings put system screen_brightness 150
β˜€οΈ Auto Brightness ON adb shell settings put system screen_brightness_mode 1
πŸŒ‘ Auto Brightness OFF adb shell settings put system screen_brightness_mode 0
πŸ’€ Turn Off Screen (Sleep) adb shell input keyevent 223
πŸ”† Turn On Screen (Wake) adb shell input keyevent 224
πŸ” Lock Screen (Power button) adb shell input keyevent 26
πŸ”“ Unlock with swipe adb shell input keyevent 82

🧠 Tip: Combine With Tap/Swipe

Wake + unlock:

adb shell input keyevent 224 && adb shell input swipe 300 1000 300 500

App Management

List & Info

Action Command
List all installed apps adb shell pm list packages
List system apps only adb shell pm list packages -s
List user-installed apps adb shell pm list packages -3
Get full path of an app adb shell pm path com.package.name
Get app’s UID adb shell dumpsys package com.package.name
Show app version adb shell dumpsys package com.package.name

Launch & Force Stop

Action Command
Launch app (via intent) adb shell monkey -p com.package.name -c android.intent.category.LAUNCHER 1
Force-stop app adb shell am force-stop com.package.name
Open app info/settings adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:com.package.name

Install / Uninstall / Clear

Action Command
Install APK adb install myapp.apk
Install and reinstall (overwrite) adb install -r myapp.apk
Install to SD card adb install -s myapp.apk
Uninstall app adb uninstall com.package.name
Uninstall app but keep data adb uninstall -k com.package.name
Clear app data (reset app) adb shell pm clear com.package.name

Example Workflow (Script)

adb shell pm clear com.example.app
adb install myapp.apk
adb shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1

File Transfer & Shell

File Transfer Between PC and Android

Action Command
πŸ”½ Pull file from Android to PC adb pull /sdcard/file.txt
πŸ”½ Pull file to specific PC location adb pull /sdcard/file.txt ./downloads/
πŸ”Ό Push file from PC to Android adb push file.txt /sdcard/
πŸ”Ό Push folder recursively adb push myfolder/ /sdcard/myfolder/
❌ Delete a file adb shell rm /sdcard/file.txt
πŸ“„ List files in a directory adb shell ls /sdcard/
πŸ“¦ Create a new folder adb shell mkdir /sdcard/myfolder

Useful Shell Commands

Task Command
Check battery status adb shell dumpsys battery
Check memory usage adb shell cat /proc/meminfo
Check CPU info adb shell cat /proc/cpuinfo
Reboot device adb reboot
Reboot to bootloader adb reboot bootloader
Reboot to recovery adb reboot recovery
Remount system as read-write (needs root) adb remount
Show device uptime adb shell uptime
List connected users adb shell who

System Control & Settings

Device Power & Reboot

Action Command
Reboot device adb reboot
Reboot to bootloader (fastboot mode) adb reboot bootloader
Reboot to recovery mode adb reboot recovery
Power off device adb shell reboot -p

Volume & Sound Control

Action Command
Set media volume (0–15) adb shell media volume --set 7 or: adb shell media volume --stream 3 --set 7
Increase volume by 1 step adb shell media volume --stream 3 --adjust raise
Decrease volume by 1 step adb shell media volume --stream 3 --adjust lower
Mute volume adb shell media volume --stream 3 --set 0
Toggle mute adb shell media volume --stream 3 --toggle-mute

πŸ“Ά Network & Connectivity

Action Command
Toggle Wi-Fi ON adb shell svc wifi enable
Toggle Wi-Fi OFF adb shell svc wifi disable
Toggle Mobile Data ON adb shell svc data enable
Toggle Mobile Data OFF adb shell svc data disable
Check current network status adb shell dumpsys connectivity
Toggle airplane mode ON adb shell settings put global airplane_mode_on 1 && adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
Toggle airplane mode OFF adb shell settings put global airplane_mode_on 0 && adb shell am broadcast -a android.intent.action.AIRPLANE_MODE

πŸ–₯️ Display & Screen Settings

Action Command
Set screen timeout (in ms) adb shell settings put system screen_off_timeout 60000
Enable auto-rotate adb shell settings put system accelerometer_rotation 1
Disable auto-rotate adb shell settings put system accelerometer_rotation 0
Set screen brightness (0–255) adb shell settings put system screen_brightness 150
Turn screen off (sleep) adb shell input keyevent 223
Turn screen on (wake) adb shell input keyevent 224

πŸ”‘Security & Lock Screen

Action Command
Lock screen adb shell input keyevent 26
Unlock screen (wake + swipe) adb shell input keyevent 224 && adb shell input swipe 300 1000 300 500
Disable lock screen security (PIN/Pattern) adb shell locksettings clear (root required)

πŸ§ͺ Example: Toggle Airplane Mode ON & OFF

adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
sleep 2
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE