Enroll Course

100% Online Study
Web & Video Lectures
Earn Diploma Certificate
Access to Job Openings
Access to CV Builder



Online Certification Courses

How To Use ADB And Fastboot On Android (And Why You Should)

How to Use ADB and Fastboot on Android (And Why You Should). 

What Are ADB And Fastboot?

ADB and Fastboot are utilities that unlock access to the Android system while your phone is connected to a desktop computer via a USB cable. The computer and cable are integral to this there's no app version, and while you can use ADB wirelessly, it's much more complicated to set up.

You normally use ADB when Android is running. It enables you to access system folders, or tweak hidden settings, which are otherwise off-limits to users. You can copy system files to and from the device using ADB, and there's also a sideload function that can be used to install system updates.

Fastboot works when Android is not running and the device is booted into "Fastboot mode" instead. It enables you to access all your device's partitions not just the Android system, but also the data partition, the boot partition, and so on.

Both are part of the Android software development kit's Platform Tools collection.

Both tools run through the Command Prompt on Windows, or Terminal on Mac and Linux. This means they aren't especially user-friendly, even though they are quite easy to get the hang of.

How To Set Up ADB And Fastboot

  1. First, you need to set up your phone to use the tools. If you haven't already, enable the Developer Options by going to Settings > About phone and tapping on Build number seven times.
  2. Then, in Settings > Developer options, check the box next to USB debugging and walk through the dialog box that follows.
  3. Download ADB and Fastboot from the Android Developer website.
  4. When you unzip the download, the contents will be collected together into a folder called platform-tools. There are several other items in the folder, but you can ignore these.

Using The Command Prompt Or Terminal

Open the Command Prompt or Terminal app. You will need to navigate to the platform-tools folder in order to use ADB and fastboot.

Do this using the cd command: enter cd [path to platform-tools]. An easier way is to type cd[space] then drag the platform-tools folder into the Command Prompt window it will autofill the path for you.

Easier still, on Windows you can hold shift while right-clicking the platform-tools folder, then select Open Command Prompt Here.

The Difference Between Windows And Mac/Linux

There's one small but essential difference between using Windows and Mac or Linux. On the latter two, every ADB and Fastboot command must be preceded by a dot-slash.

So where you type adb on Windows, you must type ./adb on Mac and Linux. And fastboot on Windows needs to be ./fastboot on Mac and Linux.

For the sake of simplicity, we'll stick with the Windows commands going forward.

How To Use ADB

Boot your phone into Android, then connect it to your desktop computer with a USB cable. On your computer, launch the Command Prompt and change the directory to point to the platform-tools folder.

Type adb devices and hit Enter. You should now see a list of attached devices, with a serial number. This shows that it is working.

That's all there is to it: type adb followed by the command you wish to execute. For another simple example, enter adb reboot to restart your phone.

How To Use Fastboot

Fastboot works the same way as ADB, except you need to boot your phone into Fastboot mode instead of Android. You normally do this by holding a combination of the power and volume keys when turning on the phone.

Alternatively, use ADB and type adb reboot bootloader.

After that it's the same. Enter fastboot devices to check that your phone is being recognized. Enter fastboot reboot to relaunch Android.

Things You Can Do With ADB And Fastboot

Now that you know how to use ADB and Fastboot, what can you do with them? Here are a few tools to try:

  1. adb pull [path to file] [path to folder] This copies a file stored anywhere on your phone, and saves it to a specified folder on your computer.
  2. adb push [path to file] [path to folder] The opposite of pull; send a file from your desktop to your phone.
  3. adb install [path to file] Installs an APK app on your phone. This is of most use to app developers.
  4. adb uninstall [package name] Uninstalls an app. You need to enter the full package name usually something along the lines of com.devname.appname instead of the common app name.
  5. adb shell wm density [dpi] Changes the pixel density of your display. A lower number fits more content onto the screen, while a higher number will fit less. For example, older devices like the OnePlus 3 have a native DPI of 480. Setting it to 400 makes text, icons, and everything else smaller.
  6. adb sideload [path to update.zip] Sideloads an update.zip firmware update. This one runs via the custom recovery on your phone. Useful if you can't wait for an update to get pushed to your device.
  7. fastboot oem unlock OR fastboot flashing unlock Which command you should use depends on which version of Android you're running. From Android 6 onwards you also need to enable OEM unlocking in Developer Options. Unlocking the bootloader this way wipes your phone completely.
  8. fastboot flash recovery [filename.img] Installs a custom recovery, such as TWRP, on your device. For ease of use, we suggest changing the recovery filename to something easy twrp.img, for instance and moving it into the platform-tools folder.
  9. fastboot -w Completely wipes your phone in preparation for flashing a custom ROM.
  10. fastboot update [path to rom.zip] Flashes a custom ROM. A useful option if you haven't rooted your phone.

Related Courses And Certification

Android Programming Course and Certification

Internet Technologies Course and Certification

Internet Marketing Course and Certification

Computer Networking Course and Certification

Basics of Computer Science - Course and Certification

Corporate Training for Business Growth and Schools