In this post, I will guide you to properly install ADB binaries on your MacBook with a straightforward method. And then, you will learn to install TWRP Custom Recovery on your Android phone using a macOS Terminal. If you are a MacBook user and at the same time, using an Android phone, this guide is for you. You might have been sticking somewhere to connect your Android phone to macOS in the Fastboot Mode. I, too, tried to unlock the bootloader of my Android phone using my MacBook but failed several times. Finally, I got a simple solution for everyone who uses MacBook and Android. Read ahead; I will use the easiest way and will provide automatic updates using Homebrew.
You might have tried the manual installation of ADB binaries on your macOS. The manual installation is quite tricky and is not friendly for novice users. So, the first time users will find my guide easy as this is an excellent solid tutorial on how to setup ADB for Mac.
If you are an Android enthusiast and want to unlock the bootloader of your Android phone, install TWRP and root, this guide is for you. ADB means Android Debug Bridge, which is a link between your Android phone and PC. ADB files are required when your phone is in Fastboot Mode, and you want to flash something on your device using Fastboot command.
Using ADB binaries, you can put some command on your macOS terminal and install TWRP Custom Recovery using the tutorial below. After that, with TWRP, you can flash anything compatible with your phone.
In Windows operating system, it’s very easy to install ADB as it only requires to copy the files to C Drive. But in Mac, you might find it difficult. So, here, I am making the thing easy for you. Read ahead; there are some tools to download. I have provided the official download links for each tool. This post has a tutorial with all of the required installation steps to get ADB on macOS.
Step #1: Download Android File Transfer DMG for macOS
The first thing you need to install on your macOS is the Android File Transfer application. It is an official software by Google for the Apple users to browse and transfer files between your Mac computer and your Android device.
Unlike Windows, macOS doesn’t require a separate Android USB Driver for each device. For example, if you are using a Xiaomi phone and want to install a custom recovery on Fastboot, you need to have a Mi Flash tool or Mi PC Suite installed on your Windows PC. But in macOS, the Android File Transfer act as a USB Driver for any Android device. You can say it a universal USB Driver for Android in macOS.
Therefore, download the Android File Transfer DMG file from the link given below and install it on your MacBook or Mac PC.
Use the USB cable that came with your smartphone box and connect it to your MacBook or Mac PC.
Double click Android File Transfer.
That’s it. You can now see all the files and folders of your Android device on your Mac.
Step #2: Install Homebrew on macOS
Homebrew for Mac is the missing package manager for macOS. It installs the stuff you need that Apple didn’t. Homebrew installs packages to their own directory and then symlinks their files into /usr/local.
In our case, Homebrew will install the Android platform-tools most easily on your Mac and will provide automatic updates. Follow the tutorial:
(Make sure your Mac is connected to the internet.)
Open the Terminal app on your Mac.
Paste the following command in macOS Terminal prompt:
TWRP (TeamWin Recovery Project) is actually a third-party and the first touch-enabled custom recovery for the Android devices which allows the users to install the third-party software including the custom ROMs, kernels, and mods. Also, it enables a user to wipe/flash the device partitions as well as to backup/restore the software.
Dee’s Troy is now leading the project along with other developers responsible for maintaining the individual device support. Presently, TeamWin officially supports over 100 Android devices from various manufacturers. Individual developers are handling the unofficial ports/development for the specific Android devices.
You must be having the following requirements to be fulfilled before you head down to install the TWRP recovery on Android using Mac.
It’s highly recommended that you must have a full backup of your device before flashing TWRP. You can do the backup on Android phones following our guide.
Be sure that your phone is charged at least 50-60% so that you can avoid sudden shutdowns during the process.
You need to download and install Android File Transfer DMG on your Mac.
You need to enable USB Debugging mode to connect your Android phone to computer.
→ (Settings > About Phone > Build number > Tap it 7 times to become developer; Settings > Developer Options > USB Debugging).
(Click to enlarge the images)
Now, open the Terminal app on your Mac.
Connect your device to PC using official USB cable (provided by device brand). You should change the USB mode to “file transfer (MTP)” mode. Some device may or may not required this, but for compatibility, it’s always good to select MTP mode.
In Terminal, type “adb devices” and hit enter to launch the ADB daemon.
On your device screen, you will see a prompt to allow or cancel USB Debugging access. Tap on “OK” to allow USB debugging. You may check the “Always Allow for this computer” option if you never want to see this pop-up again.
Note: Initially, you must enable OEM unlocking and then unblock the bootloader of your device. Please do research the community forum about how to unlock your phone, in case your smartphone comes with a factory locked bootloader. After that, get back to this TWRP tutorial.
Download TWRP Recovery Image
In order to make your effort easy, we have attached the links to all the supported Android manufacturers. You may just need to click on your device’s manufacturer name and then download the TWRP recovery for your device.
Once you are done with the downloading of the TWRP recovery for your respective Android device, you need to follow the instructions to install the recovery using macOS.
How to install TWRP on Android using macOS (Tutorial)
Download the TWRP recovery image (*.img) for your Android device on your Mac.
Copy the image file to the Desktop of your macOS.
Now Boot your Android phone into the bootloader/fastboot mode.
Connect it to the PC with the help of the USB cable (preferably the one provided by the company).
Open the Terminal application on your Mac.
Make sure that your device is being detected properly using the following command:
The command will return a unique device ID right with the ‘fastboot’ message, as shown below:
Type the following command and do not HIT enter or return button.
fastboot flash recovery
After writing “fastboot flash recovery,” drag the TWRP image file from the desktop and drop it to the Terminal. Check the screenshot below for better understanding:
After dropping the IMG file, it should appear like the screenshot below:
Finally, hit the enter/return button to install TWRP on your Android device. You should see the following message on your Terminal:
Android Devices with A/B partition system, such as the Google Pixel/Pixel 2, Moto Z2 Force, Mi A1, and Mi 9T Pro, will not be supporting direct flashing. So you will need to boot TWRP for such devices using the following command:
fastboot boot <drop TWRP img file here>
Remember to drop the TWRP image in the same way you did in step 10 of this section.
Finally, hit the enter/return button to boot your device into TWRP mode.
So this is how you can install TWRP recovery using Fastboot on Mac, which will be working for the majority of Android devices.
Saeed Ashif Ahmed is a Blogger who has a keen interest in how emerging technology can help the world become a more just, equitable, and kind place. He enjoys interviewing CEOs of tech startups asking them what they are doing to bring greater opportunity and equity to our society.