
Android enthusiasts are already in love with rooting their devices and familiar with bootloader, fastboot commands, etc. Either it is rooting the device or flashing a new kernel, the first most thing we need to do is installing ADB and Fastboot drivers. Rooting a device enlarges the customization option, and it’s better to say that with rooting, a smartphone becomes smarter. But how a device gets so much power? With Fastboot commands.
Here in this article, we will discuss some essential and useful ADB and Fastboot commands. These commands will help and assist you in entering the bootloader by rebooting your device.
List of Some Useful ADB and Fastboot Commands
Before listing all the ADB and Fastboot commands, you should know how to install ADB and Fastboot on any operating system. To understand the complete installation of ADB and fastboot and how to enable USB debugging on your Android device, follow this link.
How to Install ADB and Fastboot?
There are hundreds of ADB and fastboot commands, but most of them are not required, so we have collected and listed some important and useful fastboot commands. These fastboot commands can be executed on a terminal or command prompt in the computer while your Android device is connected with the computer with the proper required settings.
Most Common ADB commands:
Command | Description |
---|---|
adb devices | It will show list of all devices connected with the PC via ADB |
adb reboot | This command will restart your system |
adb help | This will display the help documentation of |
adb install | This will install APK files manually on the Android device using ADB |
adb recovery | This will start your Android into recovery mode |
adb install filename.apk | This will install APK files (replacing the file name with the particular APK file name) |
adb install -s filename.apk | This will install APK file in the external SD Card (if supported by the application) |
adb install -r filename.apk | This will re-install or update an APK file to the newer version on Android using ADB |
adb uninstall filename.apk | This will uninstall an APK file on your device. |
adb uninstall | This will uninstall any app using ADB command |
adb uninstall -k com.tencent.ig | This will uninstall the app keeping the data and cache untouched |
adb uninstall com.tencent.ig | This will uninstall PUBG app package (replace package name with your desired one) |
adb logcat | This will display full log data on the screen |
adb bugreport | This will check then the dumpsys, dumpstate and logcat data |
adb jdwp | This will display full list of Java Debug Wire Protocol (JDWP) processes on the Android |
adb wait-for-device | This command is used to program the device in such way so that it can wait for some time until another process is completing. |
adb get-serialno | It displays the ADB instance serial number string which is associated with the device |
adb start-server | This will start the ADB server process |
adb kill-server | This will terminate the ADB server process. |
adb restore // | This will restore the backup |
adb backup // | This will create a complete backup of your Android device and save it to the computer also. |
adb connect ip_address_of_device | This will connect the IP address of Android device to the PC. |
adb shell | This will interact with your device’s operating system |
adb reboot recovery | This will boot your device to stock recovery or TWRP from the booted OS |
adb pull /file-location-on-device/filename | This will ‘pull’ any file from Android device and send it to PC |
adb push filename /destination-location | This will ‘push’ any file to the Android device from PC |
adb sideload filename | This will flash (install) zip files directly from the command shell |
adb sideload ota-update.zip | This will used to manually install OTA updates using recovery mode (when the ZIP file is present on the computer, not in Android device) |
Rare but Important Commands
Command | Description |
---|---|
adb shell pm list packages | This command will list all the app packages |
adb shell pm uninstall -k –user 0 app-package-name | This command will uninstall system apps or any bloatware |
adb shell pm list packages -s | This command will list all the system apps |
adb shell pm list packages -3 | This command will list all the installed third-party apps. |
adb shell screencap /sdcard/screenshot.png | This command will capture screenshot from your device |
adb pull /sdcard/screenshot.png | This command will download the captured screenshot to your PC |
adb shell rm -f /sdcard/OPWallpaperResources.apk | This command will delete a file |
adb shell rm -d /sdcard/ZooperWidget | This command will delete a folder |
adb shell mkdir /sdcard/NewFolder | This command will create a new folder on your device |
adb shell cp /sdcard/OPWallpaperResources.apk /sdcard/LiveWallpapers | This command will copy a file from one location and paste it to another location (on your device) |
adb shell mv /sdcard/OPWallpaperResources.apk /system/app | This command will move a file from one location to another (on your device) |
Most Common Fastboot Commands
Command | Description |
---|---|
adb reboot bootloader | This will reboot your device to fastboot or bootloader mode |
fastboot devices | This will check whether the connection is successful or not |
fastboot oem unlock OR fastboot flashing unlock | This will unlock the bootloader of your device, type in any of the two codes (make sure ‘OEM Unlocking’ is enabled from the ‘Developer Options’) |
fastboot oem lock OR fastboot flashing lock | This will relock the bootloader of your device |
fastboot boot recovery-name.img | This will boot a recovery file on your device |
fastboot flash boot boot-file-name.img | This will flash (install) a boot file from the command shell |
fastboot flash recovery recovery-name.img | This will flash (install) a recovery file from the command shell to the recovery partition |
fastboot erase userdata | This will erase all the userdata on your device (i.e.formatting the userdata partition) |
fastboot -w | This will erase everything from your device |
fastboot getvar all | If their is dual A/B Partition in the device, then this command can be used to check current active partition. |
fastboot set_active b | If their is dual A/B Partition in the device, and you want to switch between slots, say from A to B, so this command can be used |
fastboot reboot | This will reboot your PC to Android operating system |
fastboot reboot recovery // general command fastboot oem reboot-recovery // for some devices such as Poco X2 | This will reboot from Fastboot to recovery mode, either TWRP or stock |
fastboot reboot fastboot | This can be used to boot the device to the newer FastbootD Mode |
So, these were some important ADB and Fastboot commands. I hope you like this article. If you know some more important ADB and fastboot commands that can be added to this post, or you have some more suggestions, so let us know in the comment section.
Directly in Your Inbox