Last updated on February 26th, 2018 at 12:21 pm EST
If you like to tinker around with your Android devices then you must know about adb & fastboot. These two command line commands are a must have for every Android nerd out there. In this small tutorial we will let you know how to download, install and use adb and fastboot.
What are ADB and Fastboot
ADB and Fastboot are command line utilities which work when you connect your Android device to your computer (Windows, Mac or Linux) using a usb cable. These commands let you perform actions like backing up partitions, installing apps and certain other actions which are not available via GUI. ADB works when your Android device is booted into Android, and fastboot works when your Android device not booted into Android. For fastboot, you need to work boot your Android device in fastboot mode. Using fastboot you can access all the partitions on your Android device.
Where to Download ADB and Fastboot
Hit the links below to download ABD and fastboot from Google directly. Once downloaded unzip the files, and you will have a folder named platform-tools. Inside this folder you will have the adb and fastboot executables which we will be using later.
ADB and Fastboot Drivers
Windows users also need to download and install ADB and fastboot drivers for their Android devices. You can find links to for major manufacturers below.
Mac and Linux users need not worry about drivers.
To access you device using ADB you need to enable usb debugging on your Android device. To enable usb debugging follow below steps on your Android device:-
- Navigate to Settings -> About and tap on build number seven times. You will see a message saying “Your are now a developer”.
- Go back to Settings, and you will see an option called Developer Options. Click on that and enable USB debugging.
Using ADB and Fastboot
Turn on your Android device, and connect it to your computer (Windows, Mac or Linux) using an appropriate USB cable.
Windows users need to open Command Prompt, and Mac & Linux user need to open Terminal. Once done navigate to platform-tools folder which was created when you downloaded ADB and fastboot. You can now issue adb commands.
ADB & Fastboot Commands – Windows vs Mac/Linux
When issuing adb and fastboot commands on Windows you need to type adb and fastboot respectively. For Mac and Linux, you need to use ./adb and ./fastboot.
Check Connected Devices
Once you have navigated to platform-tools folder, you can check if your Android device is connected successfully or not using adb devices command. If your device is connected successfully it will be listed once you issue the command. If you are in fastboot mode, and do a fastboot devices you will again see list of devices connected.
The first time you issue an adb command, you need to tick the box besides Always Allow from this computer. This adds your computer to list of trusted devices for adb and fastboot.
How to Boot into Fastboot from ADB
You can boot into fastboot mode by issuing below command
adb reboot fastboot
Other Important ADB and Fastboot commands
reboot your Android device normally
adb reboot bootloader
restart your device in bootloader mode
adb reboot recovery
restart your device in recovery mode
fastboot oem unlock
used to unlock bootloader in fastboot mode. Please note, not all devices support this command. Unlocking your bootloader may void your warranty and also wipe all your data.
fastboot reboot bootloader
reboot into bootloader mode from fastboot mode
fastboot flash recovery filename.img
used to flash a custom recovery on your Android device. Place custom recovery img file in same folder as platform-tools, and replace filename.img in command with name of file downloaded for example twrp.img.