ADB (Android Debug Bridge) is a powerful tool that allows developers, testers, and even normal users to interact with Android devices via a command-line interface.
To quickly find a command, use Ctrl + F
(Windows/Linux) or Cmd + F
(Mac) and type the keyword.
adb devices
Lists all connected devices.
adb kill-server
adb start-server
Kills and restarts the ADB server.
adb tcpip 5555
adb connect <device-ip>:5555
Connects to a device wirelessly.
adb install <apk-file-path>
adb uninstall <package-name>
Installs or uninstalls an APK.
adb shell screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png
Takes a screenshot and transfers it to the PC.
adb shell screenrecord /sdcard/screen.mp4
adb pull /sdcard/screen.mp4
Records the screen and saves it to the device.
adb push <local-file> <device-path>
adb pull <device-file> <local-path>
Transfers files between the PC and the device.
adb logcat
adb logcat -s "TAG"
Shows system logs for debugging.
adb shell dumpsys
Retrieves detailed system information.
adb shell dumpsys activity
adb shell dumpsys battery
adb shell dumpsys window
adb shell dumpsys wifi
adb shell dumpsys package <package-name>
Dumps specific data like battery status, running activities, Wi-Fi state, and more.
adb shell content query --uri content://call_log/calls
Retrieves recent call logs from the device.
adb shell monkey -p <package-name> -c android.intent.category.LAUNCHER 1
Opens a specific app.
adb shell am start -n <package-name>/<activity-name>
Directly navigates to a particular activity in an app.
adb shell am force-stop <package-name>
Forces an app to stop running.
adb shell pm clear <package-name>
Resets an app like a fresh install.
adb shell dumpsys battery set level 10
Simulates a low battery scenario for testing.
adb shell svc wifi disable
adb shell svc wifi enable
adb shell svc data disable
adb shell svc data enable
Disables/enables Wi-Fi and mobile data for testing.
adb shell top -n 1
Displays real-time CPU and memory usage.
adb shell pm grant <package-name> <permission>
adb shell pm revoke <package-name> <permission>
Manages app permissions programmatically.
adb shell settings put global development_settings_enabled 1
adb shell settings put global development_settings_enabled 0
Turns developer options on/off.
adb shell input keyevent KEYCODE_BACK
adb shell input keyevent KEYCODE_HOME
adb shell input keyevent KEYCODE_APP_SWITCH
Simulates hardware button presses.
adb shell input text "HelloWorld"
Sends text input to a field.
adb shell input tap 500 1000
Mimics a screen touch at a specific location.
adb reboot recovery
adb reboot bootloader
Restarts the device in different modes.
adb shell recovery --wipe_data
Performs a factory reset (use with caution!).
These ADB commands are essential for developers, testers, and even power users who want to interact with their Android devices efficiently. Let me know if you need additional commands!
β¨ Tip: You can use adb shell dumpsys | grep "keyword"
to search for specific system info quickly.