At this point, I assume that almost all of you know what it means to have root permissions on an Android device, but this does not mean that we know all the details that hide this process. Two terms mixed with root, recovery, and ROM are ADB and Fastboot. In this article, we explain what ADB is, and what Fastboot is, how to install them, and their main commands.
What are ADB and Fastboot?
The acronym ADB stands for Android Debug Bridge and corresponds to a software tool that allows us to interact with our Android smartphone from a computer. So, for example, through ADB we can execute commands to copy files from computer to phone, from phone to computer, or restart the device in bootloader mode.
Fastboot is a software tool with which we can communicate and edit system files of an Android smartphone (connected via USB cable) from a computer. With Fastboot we will be able to unlock the bootloader, start in download mode, update the firmware or restart the device through recovery.
With these two tools, we will be able to deeply modify the software of our smartphone or at least access it. Of course, all this is possible via a USB cable to connect the smartphone to the computer.
How to activate USB debugging
In order for our computer to recognize the device, it is necessary to activate USB debugging on our device. In Settings> About phone, click “Build number” several times until the development options appear. Once this simple procedure has been performed, go to the development options, and activate “USB Debugging”.
The first time we connect the phone to the computer we will have to agree to this connection. We must mark the option “Always allow from this computer” and then click I accept.
How to install the ADB and Fastboot drivers
How to install ADB and Fastboot drivers on Windows
The ADB is a fundamental part of Android Studio, the software for developing applications on Android. To download ADB you don’t need to install Android Studio in full, we just need some parts of the SDK.
We first create an SDK folder in C: / to find it easy during installation.
Now let’s go to the Android Studio download page and in the “Get only command line tools” section (on the bottom page) we have a compressed package with a.zip extension, this is what we need to download.
Now let’s unzip the folder it contains and put it in our C: / SDK / folder.
Now we enter C: / SDK / android-sdk-windows and run the ‘SDK Manager.exe’ file. In the SDK Manager we will install tools and drivers. For this we mark only these tabs in Tools and Extras:
- Android SDK Tools
- Android SDK Platform-tools
- Android Support Repository
- Google USB Driver
After checking the boxes, click “Install”. At the end of the process, we will have installed ADB and Fastboot. To start using them, go to C: \ SDK \ android-sdk-windows \ platform-tools with the Windows file explorer and in an empty place in the folder press on shit + right mouse button and select ‘Open window command here.
How to install drivers, ADB and Fastboot on Mac
For the Mac, you can find as for Windows ADB and Fastboot from the tools of Android Studio or install Homebrew and download the package with the command brew install android-platform-tools.
How to install drivers, ADB and Fastboot on Linux
On Linux, simply install the android-platform-tools package and use it from the console. For Debian based distro we install it with:
- sudo apt-get install android-tools-adb android-tools-fastboot
For ADB commands on Linux, root permissions are not required, but for Fastboot commands, yes.
adb reboot or fastboot reboot: normal reboot
adb reboot bootloader: reboot in fastboot mode (or bootloader)
adb reboot recovery: restart in recovery mode
fastboot OEM unlock: unlock the bootloader
fastboot OEM lock: lock the bootloader
fastboot erase xxx: delete the partition in question
fastboot flash bootloader nouveaubootloader.img: replace recovery with a new bootloader
fastboot flash recovery nouveaurecovery.img: install a new Recovery
adb shell: allows you to explore your phone with Linux commands (knowing that Android is linux-based)
adb remount: remount the phone system partition, then you can read and write
adb push xxx yyy: copy files from computer to phone. Indicate the complete path
adb pull xxx yyy: recover files from phone to computer
adb install fichier.apk: install an application on the phone
adb backup -all: backup everything
And finally to restore a backup file: adb restore <path to file> \ backup.ab