What “adb” is and how to prepare it
adb, or Android Debugging Bridge, is the main interface not just for debugging any Android smartphone, but also to flash, install and manipulate the phone from the comfort of your desktop computer. While it’s a CLI, the commands you are using are very few and transparent in what they’re supposed to do.
Some manufacturers or devices, especially older ones with MediaTek chips or from Samsung, also need a special driver. Unfortunately it would blow the proportions of this guide to explain every single one of them, so I’ll mainly focus on explaining how the process on devices work that do not need them. In case you need to install one for your device the process will be explained on the respective TWRP install thread on XDA for your device.
Windows
- Download the Android SDK Platform Tools
- Extract the file into some easily reachable folder, for example C:\platform-tools
- Open the folder in your explorer. Hold your shift key and right-click somewhere to open a context menu, then select “Open command window here”
- On your phone, make sure USB-debugging is enabled.
To do so, go into your phones’ settings, to “About the phone” and find the “Build Number” (some vendors tend to rearrange the system settings, so you might have to look for it). Tap it repeatedly until the phone tells you that your developer options got unlocked. They should be available in the “System” tab of your Android settings now. In there, enable USB-debugging. It should be one of the first entries. - Connect your phone with your computer. Make sure file transfer mode is enabled, as some devices need this to properly communicate with adb.
- Back on your computer, now enter “adb devices” into the command shell. Your phone should ask if you want to allow USB debugging. Naturally, we confirm.
- Entering the same command again, it should now show one device being connected. Congratulations!
GNU/Linux
- Open a terminal and install the adb tools using one of these commands:
Debian / Ubuntu based: sudo apt install adb fastboot
Arch based: sudo pacman -S android-tools
RHEL / Fedora based: sudo dnf install adb
Universal download: dl.google.com - On your phone, make sure USB-debugging is enabled.
To do so, go into your phones’ settings, to “About the phone” and find the “Build Number” (some vendors tend to rearrange the system settings, so you might have to look for it). Tap it repeatedly until the phone tells you that your developer options got unlocked. They should be available in the “System” tab of your Android settings now. In there, enable USB-debugging. It should be one of the first entries. - Connect your phone with your computer. Make sure file transfer mode is enabled, as some devices need this to properly communicate with adb.
- Back on your computer, open a terminal and enter “adb devices”. Your phone should ask if you want to allow USB debugging. Naturally, we confirm.
- Entering the same command again, it should now show one device being connected. Congratulations!
MacOS
- If you have homebrew installed:
Open a terminal and install the adb tools using this command: brew install –cask android-platform-tools
If you do not have homebrew:
Download: dl.google.com
Extract the file into some easily reachable folder, for example your desktop
Open a terminal and navigate to the folder. If it is on the desktop, the command would be cd ~/Desktop/platform-tools/ - On your phone, make sure USB-debugging is enabled.
To do so, go into your phones’ settings, to “About the phone” and find the “Build Number” (some vendors tend to rearrange the system settings, so you might have to look for it). Tap it repeatedly until the phone tells you that your developer options got unlocked. They should be available in the “System” tab of your Android settings now. In there, enable USB-debugging. It should be one of the first entries. - Connect your phone with your computer. Make sure file transfer mode is enabled, as some devices need this to properly communicate with adb.
- Back on your computer, now enter “./adb devices” into the terminal (omit ./ if you use brew). Your phone should ask if you want to allow USB debugging. Naturally, we confirm.
- Entering the same command again, it should now show one device being connected. Congratulations!
Next Page: List of known ROMs with Google-free option