ADB Commands Guide
Device Information Commands
1. View device properties (e.g., model, Android version, build number):
adb shell getprop
2. Check device status:
adb devices
3. View device battery information:
adb shell dumpsys battery
4. View device logs:
adb logcat
File Management Commands
1. Push a file to the device (copy a file from your computer to the device):
adb push <local_path> <remote_path>
2. Pull a file from the device (copy a file from your device to the computer):
adb pull <remote_path> <local_path>
3. List files and directories on the device:
adb shell ls <directory_path>
4. Create a directory on your device:
adb shell mkdir <directory_path>
App Management Commands
1. Install an APK on the device:
adb install <apk_file_path>
2. Uninstall an app from the device:
adb uninstall <package_name>
3. Start an app on the device (by package name or activity):
adb shell am start -n <package_name>/<activity_name>
4. Force stop an app:
adb shell am force-stop <package_name>
Device Control Commands
1. Reboot the device:
adb reboot
2. Reboot into recovery mode:
adb reboot recovery
3. Reboot into bootloader/fastboot mode:
adb reboot bootloader
4. Take a screenshot on the device:
adb shell screencap -p /sdcard/screenshot.png
5. Record the device screen (for screen recording):
adb shell screenrecord /sdcard/video.mp4
Network and Connectivity Commands
1. Check device's network status (e.g., Wi-Fi):
adb shell dumpsys wifi
2. Start a port forwarding session:
adb forward tcp:<local_port> tcp:<device_port>
3. Re-enable ADB over Wi-Fi:
adb tcpip 5555
4. Disconnect from a device over Wi-Fi:
adb disconnect <device_ip>:5555
System Commands
1. Reboot into safe mode (disables third-party apps):
adb shell reboot safe-mode
2. Clear app data (like clearing cache):
adb shell pm clear <package_name>
3. Check running processes:
adb shell top
4. Check for system updates (in Android 10 and above):
adb shell cmd package install-existing <package_name>
Advanced Debugging and Developer Commands
1. Start a background service on the device:
adb shell am startservice -n <package_name>/<service_name>
2. Capture a bug report (good for debugging):
adb bugreport <path_to_save_bugreport>
Useful ADB Shortcuts
1. Get device logs (filtered by a tag):
adb logcat -s <tag>
2. Run a shell command on your device:
adb shell <command>