Skip to content

All ADB Commands for Android

Connect 25

Get started

brew install --cask android-platform-tools
Installs ADB on a Mac.
winget install Google.PlatformTools
Installs ADB on Windows.
adb version
Shows your ADB version.
adb devices
Lists connected phones.
adb devices -l
Lists them with model names.
adb shell
Opens a shell on the phone.
exit
Leaves the shell.
adb help
Lists every ADB command.

Fix a connection

adb kill-server
Stops ADB on your computer.
adb start-server
Starts it again.
adb get-state
Shows if the phone is ready.
adb get-serialno
Shows the phone's serial number.
adb wait-for-device
Waits until a phone connects.
adb server-status
Shows ADB's version and Wi-Fi settings.

Wireless debugging

Turn on Wireless debugging in Developer options first.

adb pair 192.168.1.20:37099
Pairs using the code on the phone.
adb connect 192.168.1.20:41235
Connects over Wi-Fi.
adb mdns services
Finds phones on your Wi-Fi.
adb disconnect
Drops every Wi-Fi connection.
adb shell ip -f inet addr show wlan0
Shows the phone's Wi-Fi IP address.
adb tcpip 5555
Turns on Wi-Fi ADB over USB (Android 10 and older).
adb connect 192.168.1.20
Connects after adb tcpip.
adb usb
Switches back to USB.

More than one phone

adb -s 1a2b3c4d shell
Picks a phone by serial number.
adb -d shell
Picks the phone on USB.
adb -e shell
Picks the Wi-Fi phone or emulator.

Apps 28

Find apps

adb shell pm list packages
Lists every app.
adb shell pm list packages -3
Lists apps you installed.
adb shell pm list packages -s
Lists system apps.
adb shell pm list packages -d
Lists disabled apps.
adb shell pm list packages youtube
Finds apps with a word in the name.
adb shell pm list packages -i -3
Shows which store installed each app.
adb shell "dumpsys window | grep mCurrentFocus"
Shows the app on screen right now.
adb shell "dumpsys package com.google.android.youtube | grep versionName"
Shows an app's version.
adb shell pm path com.google.android.youtube
Shows where an app's APK is.

Install and uninstall

adb install app.apk
Installs an APK.
adb install -r app.apk
Updates an app and keeps its data.
adb install -g app.apk
Installs and grants every permission.
adb install-multiple base.apk split_config.arm64_v8a.apk
Installs a split APK.
adb uninstall com.example.app
Uninstalls an app.
adb uninstall -k com.example.app
Uninstalls it but keeps its data.
adb pull /data/app/~~Xf2Q==/com.example.app-Lk9w==/base.apk app.apk
Saves an app's APK (path from pm path).

Open and stop

adb shell monkey -p com.google.android.youtube 1
Opens an app.
adb shell am force-stop com.google.android.youtube
Force stops an app.
adb shell am kill com.google.android.youtube
Closes it if it's in the background.
adb shell pm clear com.google.android.youtube
Deletes an app's data.
adb shell pm trim-caches 999G
Clears every app's cache.
adb shell cmd package compile -m speed -f com.google.android.youtube
Compiles an app to open faster.

Permissions

adb shell pm grant com.example.app android.permission.CAMERA
Gives an app a permission.
adb shell pm revoke com.example.app android.permission.CAMERA
Takes a permission away.
adb shell pm grant com.example.app android.permission.WRITE_SECURE_SETTINGS
Lets automation apps change settings.
adb shell appops set com.google.android.youtube RUN_IN_BACKGROUND ignore
Stops an app running in the background.
adb shell appops set com.google.android.youtube RUN_IN_BACKGROUND allow
Lets it run in the background again.
adb shell appops get com.google.android.youtube
Shows an app's special permissions.

Debloat 8

Remove or turn off

adb shell pm uninstall --user 0 com.example.bloat
Removes an app, even a system one.
adb shell pm uninstall -k --user 0 com.example.bloat
Removes it but keeps its data.
adb shell pm disable-user --user 0 com.example.bloat
Turns an app off without removing it.
adb shell pm uninstall-system-updates com.example.bloat
Removes a system app's updates.

Bring apps back

A factory reset also brings every removed app back.

adb shell cmd package install-existing com.example.bloat
Brings back a removed app.
adb shell pm enable com.example.bloat
Turns a disabled app back on.
adb shell pm list packages -u
Lists apps, including removed ones.
adb shell pm list packages -d
Lists apps you turned off.

Files 13

Copy files

adb push photo.jpg /sdcard/Download/
Copies a file to the phone.
adb push MyFolder /sdcard/
Copies a folder to the phone.
adb pull /sdcard/Download/file.pdf
Copies a file to your computer.
adb pull /sdcard/DCIM/Camera
Copies all your camera photos.
adb pull -a /sdcard/DCIM/Camera
Copies them with their original dates.

Manage files

adb shell ls /sdcard/Download
Lists files in a folder.
adb shell mkdir /sdcard/Backup
Makes a folder.
adb shell mv /sdcard/Download/a.pdf /sdcard/Backup/
Moves a file.
adb shell rm /sdcard/Download/file.pdf
Deletes a file.
adb shell rm -r /sdcard/Backup
Deletes a folder.
adb shell "find /sdcard -name '*.apk'"
Finds files by name.

Storage

adb shell df -h /data
Shows free storage.
adb shell du -sh /sdcard/DCIM
Shows a folder's size.

Screen and buttons 32

Screenshots and recording

adb shell screencap -p /sdcard/screen.png
Takes a screenshot.
adb pull /sdcard/screen.png
Copies it to your computer.
adb exec-out screencap -p > screen.png
Saves it straight to your computer (not in PowerShell).
adb shell screenrecord /sdcard/video.mp4
Records the screen. Ctrl + C stops it.
adb shell screenrecord --time-limit 30 /sdcard/video.mp4
Records for 30 seconds.
adb shell screenrecord --size 1280x720 /sdcard/video.mp4
Records at a smaller size.
adb shell screenrecord --bit-rate 8000000 /sdcard/video.mp4
Sets the video quality.

Tap, swipe and type

adb shell input tap 540 1200
Taps the screen at a point.
adb shell input swipe 540 1800 540 600
Swipes up.
adb shell input swipe 540 1200 540 1200 800
Long-presses a point.
adb shell input text hello%sworld
Types text (%s is a space).
adb shell cmd statusbar expand-notifications
Pulls down notifications.
adb shell cmd statusbar expand-settings
Opens Quick Settings.
adb shell cmd statusbar collapse
Closes them.

Buttons

adb shell input keyevent KEYCODE_HOME
Presses Home.
adb shell input keyevent KEYCODE_BACK
Presses Back.
adb shell input keyevent KEYCODE_APP_SWITCH
Opens recent apps.
adb shell input keyevent KEYCODE_POWER
Presses the power button.
adb shell input keyevent KEYCODE_WAKEUP
Wakes the screen.
adb shell input keyevent KEYCODE_VOLUME_UP
Turns the volume up.
adb shell input keyevent KEYCODE_VOLUME_DOWN
Turns the volume down.
adb shell input keyevent KEYCODE_MEDIA_PLAY_PAUSE
Plays or pauses music.
adb shell input keyevent KEYCODE_ENTER
Presses Enter.
adb shell input keyevent KEYCODE_DEL
Deletes a letter.

Display

adb shell wm size
Shows the screen resolution.
adb shell wm size 1080x1920
Changes the resolution.
adb shell wm size reset
Puts it back.
adb shell wm density
Shows the screen density.
adb shell wm density 380
Makes everything smaller or bigger.
adb shell wm density reset
Puts it back.
adb shell wm user-rotation lock 1
Locks the screen sideways.
adb shell wm user-rotation free
Lets it rotate again.

Settings tweaks 28

Faster animations

Use 1 to undo, or 0 to turn animations off.

adb shell settings put global window_animation_scale 0.5
Speeds up window animations.
adb shell settings put global transition_animation_scale 0.5
Speeds up screen changes.
adb shell settings put global animator_duration_scale 0.5
Speeds up app animations.

Block ads with Private DNS

adb shell settings put global private_dns_mode hostname
Turns on Private DNS.
adb shell settings put global private_dns_specifier dns.adguard-dns.com
Uses AdGuard DNS to block ads.
adb shell settings get global private_dns_specifier
Shows your DNS.
adb shell settings put global private_dns_mode off
Turns Private DNS off.

Screen and power

adb shell cmd uimode night yes
Turns dark mode on.
adb shell cmd uimode night no
Turns dark mode off.
adb shell settings put system screen_brightness 200
Sets brightness (0 to 255).
adb shell settings put system font_scale 1.15
Makes text bigger.
adb shell settings put system screen_off_timeout 600000
Keeps the screen on for 10 minutes.
adb shell svc power stayon true
Keeps the screen on while charging.
adb shell svc power stayon false
Turns that off.

Connections

adb shell cmd wifi set-wifi-enabled disabled
Turns Wi-Fi off.
adb shell cmd wifi set-wifi-enabled enabled
Turns Wi-Fi on.
adb shell cmd wifi status
Shows Wi-Fi details.
adb shell svc data disable
Turns mobile data off.
adb shell svc data enable
Turns mobile data on.
adb shell svc bluetooth disable
Turns Bluetooth off.
adb shell svc bluetooth enable
Turns Bluetooth on.
adb shell cmd connectivity airplane-mode enable
Turns airplane mode on.
adb shell cmd connectivity airplane-mode disable
Turns airplane mode off.

Open settings screens

adb shell am start -a android.settings.SETTINGS
Opens Settings.
adb shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS
Opens Developer options.
adb shell am start -a android.settings.WIFI_SETTINGS
Opens Wi-Fi settings.
adb shell am start -a android.intent.action.VIEW -d https://techpp.app
Opens a website.
adb shell settings list global
Lists every global setting.

Phone info and logs 29

About the phone

adb shell getprop ro.product.model
Shows the model.
adb shell getprop ro.product.brand
Shows the brand.
adb shell getprop ro.build.version.release
Shows the Android version.
adb shell getprop ro.build.version.security_patch
Shows the security patch date.
adb shell getprop ro.build.display.id
Shows the build number.
adb shell getprop ro.soc.model
Shows the chip model.
adb shell getprop ro.product.cpu.abi
Shows the CPU type.
adb shell "grep MemTotal /proc/meminfo"
Shows total RAM.
adb shell settings get secure android_id
Shows the Android ID.
adb shell uptime
Shows time since the last restart.
adb shell getprop
Lists every property.

Battery

adb shell dumpsys battery
Shows battery level, health and heat.
adb shell "dumpsys battery | grep level"
Shows just the battery level.
adb shell cmd battery unplug
Acts as if the charger is unplugged.
adb shell cmd battery set level 15
Fakes a battery level for testing.
adb shell cmd battery reset
Goes back to the real battery.

Speed and memory

adb shell top -n 1
Shows what's using the CPU.
adb shell dumpsys cpuinfo
Shows CPU use by app.
adb shell dumpsys meminfo
Shows memory use by app.
adb shell dumpsys meminfo com.google.android.youtube
Shows one app's memory use.
adb shell dumpsys thermalservice
Shows the phone's temperatures.
adb shell dumpsys gfxinfo com.google.android.youtube
Shows an app's frame times.
adb shell ps -A
Lists every running process.

Logs and bug reports

adb logcat
Shows the live log.
adb logcat "*:E"
Shows only errors.
adb logcat -b crash
Shows only crashes.
adb logcat -d > log.txt
Saves the log to a file.
adb logcat -c
Clears the log.
adb bugreport
Saves a full bug report as a zip.

Reboot and fastboot 24

Restart

adb reboot
Restarts the phone.
adb reboot bootloader
Restarts into the bootloader (fastboot).
adb reboot recovery
Restarts into recovery.
adb reboot fastboot
Restarts into fastbootd.
adb reboot sideload
Restarts ready to sideload an update.
adb sideload update.zip
Installs an update file.
adb shell svc power shutdown
Turns the phone off.
adb root
Restarts ADB as root (test builds only).

Fastboot basics

fastboot devices
Lists phones in fastboot.
fastboot reboot
Restarts into Android.
fastboot reboot bootloader
Restarts the bootloader.
fastboot reboot recovery
Restarts into recovery.
fastboot reboot fastboot
Switches to fastbootd.
fastboot getvar all
Shows every bootloader detail.
fastboot getvar current-slot
Shows the active slot.

Unlock and flash

Turn on OEM unlocking in Developer options first.

fastboot flashing get_unlock_ability
Checks if unlocking is allowed.
fastboot flashing unlock
Unlocks the bootloader. Wipes the phone.
fastboot flashing lock
Locks it again. Resets the phone.
fastboot flash boot boot.img
Flashes a boot image.
fastboot flash init_boot init_boot.img
Flashes init_boot on newer phones.
fastboot boot boot.img
Boots an image once without flashing.
fastboot set_active b
Switches to slot b.
fastboot update image.zip
Flashes a full factory image zip.
fastboot -w
Wipes all your data.