Complete List of Useful ADB and Fastboot Commands
Android Debug Bridge (ADB) is a program that allows developers to control and manage Android devices. Using ADB, you can troubleshoot problems on your Android device.
Setting up ADB
To use ADB, we first need to configure it. Android Development Tools (ADB) is a part of the Android SDK which you can find on the Android website. After downloading the SDK, you will need to extract the files to a folder on your computer.
To play our game, you’ll need to connect your Android device to your computer using a USB cable. To check if your device is connected to the computer and has USB debugging enabled, look for a small, blue light on the side of the device.
To get started debugging USB devices on your phone, go to the Settings app and turn on “Developer options” (it’s under the “Settings” menu). Then, make sure USB debugging is enabled. Go to the directory where you downloaded the Android SDK files.
To make sure your device is connected to ADB and recognized type “adb devices“.
Basic ADB Commands
In order to help you troubleshoot your Android device, we’ll need to know about ADB (Android Debug Bridge). ADB is a tool that lets you communicate with your Android device from a computer. With ADB, you can do things like fix problems or check your device’s settings.
Installing an App
To install an app using ADB, you’ll need the app’s APK file. This file is a package of files that contains the app’s code and assets. To install the app on your phone, connect your phone to your computer and open a command prompt or terminal window. Download the app’s APK file and install it.
To install the app on your device, go to the directory where the APK file is and type “adb install appname.apk“.
Uninstalling an App
To uninstall an app using ADB, connect your device to your computer, and launch a command prompt or terminal window. To uninstall the app from your device, type “adb uninstall packagename“.
We are going to remove the app “packagename” from your device.
Rebooting your Device
To reboot your device using ADB, connect your device to your computer and launch a command prompt or terminal window. In the command prompt or terminal window, use the ADB command to reboot your device.
To restart your device, type “adb reboot.” Your device will turn off and then turn back on again.
Taking a Screenshot
To take a screenshot with ADB, connect your device to your computer and launch a command prompt or terminal window. To take a screenshot of your device, you need to use the “adb shell” command. This command will take a screenshot of your device’s screen and save it to the “sdcard” folder.
Type “adb shell screencap /sdcard/screenshot.png”
The screenshot will be saved to your phone’s storage directory.
Transferring Files
To transfer files between your device and computer using ADB, connect your device to your computer and open a command prompt or terminal window. To move a file from your computer to your device, you can use the “adb push” command. This will copy the file from your computer to the “SD card” on your device.
Type “adb push localfile /sdcard/remotefile”
Type “adb pull /sdcard/remotefile localfile”
To move a file from your device to your computer, you can use the adb command to pull it from the SD card.
You can save a file on your device or on your computer.
The adb reboot command
adb reboot
This command is extremely useful for custom ROM developers and Android developers in general. There are times when developers must restart Android devices.
As a result, typing the command rather than pressing the button is more convenient. This can also be automated by running a script while installing a custom kernel or ROM. In short, it is a very useful command for regular Android users.
The adb reboot-bootloader and adb reboot recovery commands
The previously discussed command can be used to reboot a device. There are, however, other basic ADB commands you can use to reboot your device in a specific mode.
adb reboot recovery
You can reboot your device into bootloader mode using the “adb reboot recovery” command. It is simple to do; simply type adb reboot-bootloader and press the enter key.
adb reboot bootloader
This command will boot your device into bootloader mode, allowing you to unlock the bootloader, reboot into fastboot and recovery mode, and perform other tasks.
Fastboot devices command
None of your so-called ADB commands will work while in bootloader mode. This is because the Android has not been booted and the USB debugging bridge has not been activated to communicate with the device. To communicate with the device in such cases, we use the “fastboot” command.
Fastboot is one of the most useful and life-saving adb commands for Android users. You can send files, communicate, reactivate deal smartphones, and do a lot more. However, make sure you have adequate fastboot drivers for your Android device, as adb drivers will not work here.
adb reboot fastboot
You can use the above command to boot your device directly to fastboot mode.
fastboot device
This command will determine whether the device is connected to a computer.
Fastboot unlock command
If you want to unlock the bootloader on your Android device, this command will assist you. However, not every device supports bootloader unlocking; however, if it does,
You can use the fastboot command to accomplish this. This is the beauty of the Android open system: Google and smartphone manufacturers are unconcerned about what users do with their devices.
They are open to any type of experiment.
Here is few bootloader unlock command:
fastboot flashing unlock
fastboot oem unlock
To check whether your device bootloader unlocked or not
fastboot oem device-info
The adb sideload command
Do you want to install an unofficial OTA (over-the-air) update on your device? We’ve got you covered, fam. You can use the adb sideload command to install an unofficial/official OTA update.
All you have to do is enter recovery mode and use the up/down arrow keys to navigate to “Apply update from ADB.” After that, enter the following command and you’re ready to go:
adb sideload Full-Path-to-the-file.zip
Command | Functions |
ADB Commands | |
adb devices | Shows attached devices |
adb shell | To jump from windows command prompt to android device shell: |
adb reboot bootloader | To boot into bootloader mode |
adb reboot recovery | To boot into recovery |
adb get-serial no | Get Serial Number of your connected device |
adb install | To install apps over adb |
adb install -r | To update the existing apps with new version |
adb uninstall package_name.here | To uninstall any apps or packages from the connected device |
adb uninstall -package_name.here | Keep the data and cache directories after uninstalling apps |
adb push <local> <remote> | Upload a specified file from your computer to device |
adb pull | Download a specified file from your device to your computer. |
adb backup | Take backup from your device to PC |
adb restore | Restore the backup to your phone |
adb sideload | To sideload apps or flashable zip file to your device |
adb logcat | Take the real-time log from your phone |
adb start-server | start adb servers processes |
adb kill-server | stop adb server processes |
adb reboot fastboot | reboot your device into fastboot mode |
adb usb | shows all devices connected to your computer via a USB cable. |
adb devices //show devices attached | It will display the list of all devices attached to your PC. |
adb connect ip_address_of_device | connect the IP address of your Android device to your computer. |
Fastboot commands | |
fastboot devices | Shows connected devices on your PC/Laptop |
fastboot reboot | To reboot your device |
fastboot reboot recovery | To boot your device into recovery mode |
fastboot oem device-info | To check the bootloader unlock status: |
fastboot oem unlock | If the above command returns fall, run the following to unlock the bootloader |
fastboot flashing unlock | Few OEM may use this command to unlock the bootloader |
fastboot flashing unlock_critical | Allow flashing of bootloader related partitions too: |
fastboot oem device-info | check bootloader lock/ unlock status |
fastboot flash recovery [recovery.img] | To flash recovery on your device |
fastboot boot [boot.img] | To test the recovery without permanently flashing |
fastboot format:ext4 userdata | To format data partition |
fastboot flash boot [boot img name] | flash flashable boot.img from fastboot mode |
fastboot getvar cid | To display the CID of your device |
Flashing ROM via Fastboot ROM zip package | |
fastboot -w | To wipe your device |
So, guys, those are all the basic ADB commands you should be familiar with if you’re an Android fan. I’m sure you discovered a lot of new information today. In the comments section below, let us know which command you liked best.