How To: Install ADB & Fastboot in Mac OS X to Send Commands to Your HTC One

Install ADB & Fastboot in Mac OS X to Send Commands to Your HTC One

If you're looking into rooting your device yourself, you're going to need ADB and Fastboot on your computer.

The Android Debug Bridge (ADB), is a command-line-based tool that allows for interaction between your computer and your Linux-based Android device. Fastboot is an engineering protocol that allows modification to file system images from a computer over a USB connection.

Both ADB and Fastboot are packaged as a part of the Android Software Development Kit (SDK), and allow you to perform simple tasks like pushing and pulling files from your device, but they can also manipulate your bootloader and install custom recoveries.

Usually, you would have to install the Android SDK to get both tools, but today I'm going to show you how to get both on your Mac in less than 5 minutes!

  1. Download this Android.zip file to your Mac.
  2. Extract the .zip and place the Android folder on your Desktop.
  3. Open Terminal and type: cd Desktop/Android
  4. Now install ADB and Fastboot: ./ADB-Install-Mac.sh
  5. Allow the script to run and you'll be all set. Now the ADB and Fastboot files will be placed in /usr/bin/ on your Mac.

Note: Change Desktop/Android above to the location of the extracted .zip if you didn't place it on you Desktop like I did.

With ADB and Fastboot, you'll be able to run commands from your Mac onto your HTC One or other Android device. This will come in handy when you are rooting your device or backing up your data.

Android apple eater image via MacBook Designs

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

36 Comments

my friend I'm do it all the steps in my mac but not connected with my htc one any idea

When you type 'adb devices' into terminal does it give you a list of devices? Try switching USB ports, that can be an issue sometimes. Also be sure to have USB Debugging enabled on your devices before hand.

You may also want to check your /usr/bin/ folder and make sure adb and fastboot are there. To check open Finder hit Shift, Command and G all at the same time and type /usr/bin/ in the box that pops up. If they are not there that means something went wrong in the install script.

You can manually add them to that folder. So just unzip the Android.zip file again and place them in there.

I'm running into a similar problem on my end. Perhaps the ADB files are outdated?

The ADB-Install-Mac.sh script didn't work out of the box, and needed 2 changes...

I had to change this line:

sudo mv Mac/adbMac /usr/bin/adb #Moves adb

to:

sudo mv Mac/adb /usr/bin/adb #Moves adb

And this line:

sudo mv Mac/fastbootMac /usr/bin/fastboot #Moves Fastboot

to:

sudo mv Mac/fastboot /usr/bin/fastboot #Moves Fastboot

After that, it worked great. Thanks!

thank u it's work now

My issue isn't the installation of adb or fastboot, but rather that the HTC One doesn't prompt for the transferring of the SSH Public keys (like it does on Windows devices). As of 4.4 (KitKat) adb won't recognize any devices that haven't been authenticated.

So how does one go about authenticating the device on Mac? On Windows its just a matter of installing the google drivers and getting them updated in device manager.

When you plug in your device do you see a pop up on your phone asking to accept the connection?

What if I'm stuck on unlock key in step??

Thanks for this. If your a mac user, it's probably a lot easier to just drag and drop the files into the /usr/bin/ directory. Thats all the ADB-Install-Mac.sh is supposed to do anyway, however the script didn't execute properly for me. Dragging and dropping resolved the issue.

Not only did the script not work for me, it won't even let me drag and drop into the usr/bin folder. Suggestions?

What error are you getting when you drag and drop?

hi... i have very similar problem like the topic above... because i want to survive my droid (4.2.2 J.B) from being stocked in INFINITE Bootloader (start up) it happens when i rootd my droid and add some stuff from Xposed installer... and i was searching for unblocking the Bootloader with the used of ADB ? but my Droid is not Debug mode ??? and i'm also try the threads here but HOW ??? my computer doesn't read my droid/phone i cant turn ON my Droid Storage in my phone Screen. is it still need to Debug mode ? pls P.M ( fb.com/erolled or erolled@gmail.com ) me if u care and have some Bright idea how to solve my problem and also some User have same Problem... thnks a lot :D

If you place your phone in recovery mode you can send ADB commands through TWRP.

This 'zip' i'm downloading is a .zip.dmg file. Which I cannot even open because the file that is inside that so called zip does"t do anything....

I just checked and the zip linked in the guide should just have the .zip extension. Retry the download and let me know if the .dmg extension is still there.

its still there

edit: I tried removing the .dmg as that usually works, it created a .zip that extracts into a .zip.cpgz that extracts into a new .zip and back and forth

It is possible to do this without admin rights?

No, you need the admin rights to add files to the bin directory.

Last login: Tue Jun 16 22:29:21 on ttys000
Jennifers-MacBook-Pro:~ chielgerritsen$ cd Desktop/Android
Jennifers-MacBook-Pro:Android chielgerritsen$ ./ADB-Install-Mac.sh
-bash: ./ADB-Install-Mac.sh: /bin/bash./: bad interpreter: No such file or directory
Jennifers-MacBook-Pro:Android chielgerritsen$

this the only thing i keep getting

what should i do?

Did you unzip the downloaded file and place the extracted folder on the desktop?

so i've installed it but how do i use commands now? i'm used to opening a cmd in the folder itself on windows but dont know how to in mac

The ADB/fastboot commands are installed system wide so you can use them anytime you open up Terminal.

Hi.
I used your file and it all worked fine... so THANKS!

BUT Recently I updated from Yosemite to El Capitan... and now ADB does not work anymore, and even re-installing your script yields no results.

Help? çç

You can download the file again, unzip and then manually place the adb and fastboot files in your /usr/bin/ folder.

El Capitan won't give permission.

so i installed everything correctly and it is working. but now i want to pull a file from my phone to my mac, i would use android file transfer but the file i want to pull is a backup that is 5.3 gigs. so i do:

adb pull /sdcard/twrp/backups/SH455WM00513 /Users/BartDuwez/Desktop

it starts working but i dont see any progress or idee of where it is. so i wanted to add -p to the command which should show me a progress, but this does not seem to be included in this adb, how do i get it included?

thanks :)

Hi there...I installed this because I need to run "fastboot reboot" to power up my android on my Mac because it has a broken on / off button http://forum.xda-developers.com/droid-turbo/help/power-button-broken-workaround-t3157271. Only problem is I don't quite understand how I use the "fastboot reboot" command in terminal once I've followed the above installation instructions, i.e. at what point / where do I type in the command in Terminal (it's been a while since I've done anything in Terminal or on the command line). Thanks!

Hi!

I have some changes and explanations.

this is the wright code for the "/ADB-Install-Mac.sh":

#!/bin/bash

# ADB Install.sh
#
# This script installs adb and fastboot into /usr/bin/
# This may be run from anywhere and is compatible with Linux
# and Mac OS X. Hopefully a Windows batch file will be available
# very soon.
#
# Created by kalaker on 04/20/2012
# Updated by kalaker on 05/30/2012
# http://forum.xda-developers.com/member.php?u=4510103 <-My XDA Profile
echo "This will install ADB and Fastboot on your computer."
echo "Root Permissions required. Please type your password."
sudo cd ~ #Gives Superuser permissions
cd "`dirname "$0"`" #CDs to script directory
echo "Changed directory to `pwd`" #Informs user of path change
echo "Moving ADB"
sudo cp Mac/adb /usr/bin/adb #Moves adb
echo "ADB Moved to /usr/bin/adb"
echo "moving Fastboot"
sudo cp Mac/fastboot /usr/bin/fastboot #Moves Fastboot
echo "Fastboot moved to /usr/bin/fastboot"
echo "You may now run Android Debug Bridge and Fastboot commands"
echo "Have a nice day."

If you have problems when you run the script, it's maybe because you can't copy or move the files to "/usr/bin/" folder.

to fix this problem you can do this:

  1. Turn off your Mac.
  2. Enter Recovery Mode: Turn on your Mac and press cmd + R untill the screen changes.
Image via tekrevue.com
  1. Click on Utilities ant the Menu bar and select "Terminal".
  2. run this scritp (widthout the commas):

"csrutil disable; reboot"

Wait for reboot...

  1. Open terminal in your Mac and run "/ADB-Install-Mac.sh" again.

Thats All!
Cheers!

The link to to the unzip isn't working

Share Your Thoughts

  • Hot
  • Latest