ADB and Fastboot commands are powerful tools for Android users to troubleshoot and fix common device issues. This guide provides a list of essential commands and tips to help you take control of your device.
The first command to check if your device is properly connected:
adb devicesThis will list all connected devices. If your device appears, you’re good to go. Otherwise, you may need to troubleshoot your USB connection or drivers.
To reboot your Android device, use:
adb rebootThis is useful when your device is stuck or not responding. You can also reboot into recovery or bootloader mode with:
adb reboot recovery
adb reboot bootloaderTo transfer files from your computer to your Android device:
adb push <local_file_path> <remote_file_path>Example:
adb push myfile.zip /sdcard/myfile.zipTo transfer files from your Android device to your computer:
adb pull <remote_file_path> <local_file_path>Example:
adb pull /sdcard/myfile.zip ./myfile.zipTo flash a custom recovery like TWRP:
fastboot flash recovery recovery.imgThis command is essential for installing custom software on your Android device.
To flash a boot image:
fastboot flash boot boot.imgThis is often used when installing a custom kernel or fixing boot issues.
To unlock your bootloader for rooting or custom ROM installation:
fastboot oem unlockNote: Unlocking the bootloader will wipe all data on your device. Back up important data before proceeding.
To relock the bootloader:
fastboot oem lockThis is useful if you want to restore your device to its original state.
For manually installing a software update:
- Boot into recovery mode.
- Use the following command:
adb sideload update.zip
This command is particularly useful when OTA (Over-The-Air) updates fail to install.
To erase specific partitions (e.g., cache, userdata):
fastboot erase <partition_name>Example:
fastboot erase cacheTo format a partition:
fastboot format <partition_name>Example:
fastboot format userdataTo reboot the device from Fastboot mode:
fastboot rebootYou can also reboot into bootloader mode using:
fastboot reboot bootloaderTo flash a system image:
fastboot flash system system.imgThis is useful for restoring stock firmware.
To open a shell on your Android device:
adb shellYou can execute commands directly on the device from the shell. Example:
adb shell ls /sdcardTo install an APK file on your device:
adb install <apk_file_path>Example:
adb install app.apkTo uninstall an app from your device:
adb uninstall <package_name>Example:
adb uninstall com.example.appIf your device is stuck in a bootloop, clear the cache partition with:
fastboot erase cacheFor devices stuck in a "bricked" state (won’t boot at all), flash the stock firmware:
fastboot flash system system.imgNote: Ensure you download the correct firmware for your device model before flashing.
If your device becomes unresponsive, reboot it using:
fastboot rebootThis simple command often resolves issues.
To clear space by removing unnecessary files:
adb shell rm -rf /sdcard/<folder_or_file_name>To view the logcat (system logs) for troubleshooting:
adb logcatYou can filter logs for specific tags or errors, for example:
adb logcat *:E- Backup Your Data: Always back up your data before using any ADB Fastboot commands that modify your system.
- Use Verified Firmware: Ensure you’re using the correct firmware files for your device model to avoid bricking your phone.
- Follow Instructions Carefully: If you’re unsure about a command, double-check the documentation or seek expert advice.
- Charge Your Device: Ensure your device has sufficient charge before performing operations to prevent interruptions.
ADB and Fastboot commands are essential tools for Android users who want to troubleshoot, customize, or fix their devices. Whether you’re fixing bootloop issues, flashing custom ROMs, or unlocking your device’s bootloader, these commands make the process quick and painless. With the right setup and some caution, you’ll be able to resolve common Android issues in just a few minutes.