[GUIDE] Set up ADB and Fastboot on a Mac easily (With Screenshots!)

Search This thread

naijo7

New member
Apr 21, 2016
1
0
not working for me

Hello:
1. I downloaded Android Studio "android-studio-ide-143.3101438-mac" and looking into it's contents, I didn't find "tools" folder with "adb" & "fastboot" files. So I downloaded the file at the bottom of the thread.

On my mac, I got it working by going to "/Users/apple/Library/Android/sdk/platform-tools" and copy the "abd" & "fastboot" files from there.
 
Last edited:

dirgekv2

New member
Jun 23, 2015
2
1
I set up ADB/Fastboot successfully on my Mac, and am able to sideload OTA updates on my Nexus 6, however, when it comes to flashing a factory image it doesn't work.

Wouldn't it be the same procedure as on windows? Unzip the zip file, copy the 6 files to platform-tools, then initiate the flash-all script in the command prompt?
 

sn0warmy

Senior Member
Jul 26, 2010
3,392
1,642
Boulder, CO
2016 Macbook Pro Users - Read This

I purchased a new Macbook Pro (Late 2016) which only has Thunderbolt (USB-C) ports and no standard USB ports.

I followed the instructions in the OP of this thread to setup ADB/Fastboot on the new mac, like I did on my previous macs. However, I could not get the computer to recognize my phone with the USB-C to USB-C cable that came with my Google Pixel. I also tried using the USB-C to USB-C cable that came with my Nexus 6P that didn't solve the problem.

So I went and bought a Thunderbolt to standard USB adapter and plugged it into the USB to USB-C cable that came with my Pixel and Voila! the computer recognizes the phone perfectly now with ADB and Fastboot commands.

30967127495_d400612001_z.jpg


I just wanted to share this so others can save themselves the time of pulling their hair out trying to figure out trying to get it to work with their new mac.
 
Last edited:
  • Like
Reactions: Aksell and JoeDoom

Snüber

Member
Apr 11, 2014
34
2
struggled so much with adb and fastboot installtion but your guide finally solved it! THANK YOU SO MUCH
 

sfino89

Member
Sep 14, 2013
16
4
Since this is a pretty old thread, but people still need to use adb & fastboot:

Wouldn't it be easier to just install homebrew and then do 'brew install android-platform-tools'?

Hey thanks for this info it really helped. Do you by anychance know where to place the twrp file or the commands to flash twrp so it can find it
 

Aksell

Senior Member
Oct 8, 2016
374
117
Why am I getting this Error I'm trying to flash stock rom on my phone I got I Mac late 2012:crying:HALP
 
Last edited:

Lacynicole04

New member
Apr 25, 2017
1
0
Lake Charles
terminal problems please help

okay so every time i do this process i keep getting "command not found"

so heres what my terminal window look like when i open it

Last login: Fri Jun 2 15:08:29 on ttys000
-bash: touch: command not found
Process name
Lacynicole:~ lindy_hamilton$ Process name
-bash: Process: command not found
Lacynicole:~ lindy_hamilton$

no matter what i delete or re do or try to fix i get this screen
and any command i try i get command not found or can not open pseudo tty
what is wrong and how do i fix it?
 

Fafa980

New member
Jun 11, 2017
1
0
Hey Guys,

I think mine is not working....it shows offline device...
Sorry I have no knowledge in this stuff...can anyone help?

Thanks :)
 

WortownBC

New member
Jun 12, 2017
1
0
Im having an issue. when i type in "./adb devices" it shows my serial number but it is followed by offline. i thought i couldignore it but its creating problems when i go to root my phone. none of the adb commands are working such as " adb reboot bootload"
 

Chaplan

Senior Member
Jan 8, 2008
1,334
2,243
No Place
Xiaomi Mi Pad 4
Google Pixel 4a
Im having an issue. when i type in "./adb devices" it shows my serial number but it is followed by offline. i thought i couldignore it but its creating problems when i go to root my phone. none of the adb commands are working such as " adb reboot bootload"
You need to enable adb debugging under developer options, run the command.
Android will ask for that particular computer to be or not approved.
Say yes and you are good to go.
If the problem persists try to revoke USB debugging authorizations and it should ask again.
It's pretty straight forward on a Mac.
 

kashifnazir

Member
Feb 14, 2011
13
0
Halifax
Hi,

I am on Nexus 6P Oreo and want to downgrade back to nougat. Unfortunately my bootloader is locked. When following the instructions, typing './adb devices' in terminal shows my device, as does typing in './fastboot devices'. However, the next line when I put in './fastboot flashing unlock' to unlock the bootloader, i get the below;

Kashifs-MacBook-Air-2:Mac Kashif$ ./fastboot flashing unlock
usage: fastboot [ <option> ] <command>

commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message

options:
-w erase userdata and cache (and format if supported by partition type)
-u do not first erase partition before formatting
-s <specific device> specify device serial number or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048
-S <size>[K|M|G] automatically sparse files greater than size. 0 to disable

This appears to be a generic help menu and I'm not sure if the commands have changed with Oreo but i really need to go back to nougat (hate oreo!lol) Any help with this would be much appreciated!
 
Last edited:

RoverChr0me

Member
Oct 7, 2017
19
3
Ok, so I'm going to make a little write up on how to easily install ADB and fastboot on a Mac. It's actually quite simple, and plus you don't have to worry about drivers like in Windows.

Instructions

First, make a folder named "android" (no quotes of course :)) You can place it anywhere on your hard drive, it doesn't really matter. Put it somewhere you'll easily remember, because you're going to be using it a LOT. I placed mine on my desktop.
ScreenShot2012-10-02at42205PM.png


Next, you'll want to download the android SDK from Here. (you won't need to install Java first like you would on a Windows PC, though I would recommend it anyway)
(As pointed out by Wlmeng11, you could skip this step just download a zip that I will have attached at the bottom of the page containing the adb and fastboot files instead of downloading the whole SDK)
ScreenShot2012-10-02at42257PM.png


When the SDK finishes downloading, Unzip it and the contents of the "android-sdk-mac_x86" folder into your android folder.

Once you have done that, open your android folder. Go into the tools folder inside of it. Double click on the file called "android" (possibly called android sdk) This file is a UNIX executable and will open within a Terminal window.
ScreenShot2012-10-02at42232PM.png


When it finishes opening, check the folder called tools. Make sure both "Android SDK Tools" and "Android SDK Platform-tools" are selected within the tools folder. Click install and wait for them to download.
ScreenShot2012-10-02at42242PM.png


When they finish downloading, go into the platform-tools folder inside your android folder, then copy adb and fastboot and paste them into the root of your android folder.
ScreenShot2012-10-02at42733PM.png


Now that you have adb and fastboot installed, we're going to want to test them to make sure they work.

Go ahead and plug in your android device at this time. Make sure android debugging is enabled in settings. Go into Settings > Apps > Developer and check it there (for Gingerbread 2.3 and lower) or go into Settings > Developer Options and check it there for Ice Cream Sandwich or Jellybean. As of now, there are two ways to access adb and fastboot.

Open a Terminal window (look in Applications > Utilities if you can't find it). Type "cd" followed by the path you saved your android folder to (I'm going to use the Desktop for this demonstration) it should look like this
Code:
cd /Users/<yourusername>/Desktop/android
ScreenShot2012-10-02at43423PM.png


Press enter.
ScreenShot2012-10-02at43424PM.png


Now you need to actually execute an adb or fastboot command. To do this, you'll need to type "./adb (or fastboot) <command>" For this tutorial, we will use "ADB devices" since it doesn't actually do anything to the phone. (we won't use fastboot since it requires rebooting to the boot loader which is different for every device)

In the same terminal window as before type the following:
Code:
./adb devices
then hit enter. It should turn up your device's serial number. If it does, proceed to the next step, if not recheck your steps, then leave a post in this thread.
ScreenShot2012-10-02at44100PM.png


(if it says * daemon not running. starting it now on port 5037 *
* daemon started successfully * that is perfectly normal)

Now, at this moment, ADB and Fastboot are both completely useable. However, it's very annoying to have to CD into the directory and use ./ in front of every terminal command. I'll show you how to add it to your path so you don't have to do any of that.

Open a new Terminal window and type
Code:
nano ~/.bash_profile

it will open a window that looks like this:
ScreenShot2012-10-02at44356PM.png

(Yours will probably be blank, because I've added a lot of stuff to mine over the years)

Add a line to it that contains the path to your android folder. (again, I'm using Desktop) It should look like this
Code:
export PATH=${PATH}:/Users/<yourusername>/Desktop/android
ScreenShot2012-10-02at44544PM.png


Once you have added that, press CTRL+X to exit, then Y to confirm the save then press enter. It will close the nano editor. You can close the Terminal window now.

Now we need to verify that it works. Open a new Terminal window and type
Code:
adb devices
If it shows the serial number, then you have set it up successfully and are good to go!
ScreenShot2012-10-02at44817PM.png


If you have any questions or issues let me know in the thread below.

If this has helped, please press thanks!

Awesome! This made the front page of XDA :) Thanks guys!

Thanks
 

snek_one

Member
Jun 29, 2009
9
2
The Hague
I think there's an easier way to install

I had a look at the tutorial to see how to install adb and it seemed a bit too complicated and I really didn't feel like reading at the moment hehehe.. I had this suspicion adb might be available through brew cask. Turns out I was right, although not as a standalone package. The SDK Platform Tools are available and the only packages that are installed then are:
Code:
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/adb (Binary)
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/dmtracedump (Binary)
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/etc1tool (Binary)
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/fastboot (Binary)
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/hprof-conv (Binary)
/usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/sqlite3 (Binary)

It's downloaded as a zip and in total it's only 5MB.
So in theory the guide to installing ADB and Fastboot can be brought back to this:
Code:
# Install brew if not installed yet (really?)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Give it an update to be on the safe side, cask requires brew > 0.9.5
brew update
# Enable brew cask (this basically pulls a copy of the repo from https://github.com/caskroom/homebrew-cask)
brew tap caskroom/cask
# Install the package
brew cask install android-platform-tools

It creates symlinks in /usr/local/bin so as long as you have that path in your $PATH the tools should work from anywhere.
Oh btw you don't need to use ${PATH} in .bash_profile you can just use $PATH.
The one thing that's important to remember about using the export command in the .bash_profile is that directories are searched in the order set in the variable. So lets say you have 2x adb installed:
- /usr/local/bin/adb
- /Users/your-home/bin/adb
If you want the one in your-home/bin dir to load first you would export like so:
Code:
export PATH=$HOME/bin:/usr/local/bin:$PATH

I think that's the generally accepted loading order, that way you can override packages from /usr/bin, /sbin etc by placing a similarly named package in /usr/local/bin and even override that one by place it in $HOME/bin.

Have a look at cask some more if you're not familiar with it, you can install a LOT of software with it that's not available through brew normally. Just do a "brew cask search" without an actual search parameter and it will return all packages available..
 

Top Liked Posts

  • There are no posts matching your filters.
  • 316
    Ok, so I'm going to make a little write up on how to easily install ADB and fastboot on a Mac. It's actually quite simple, and plus you don't have to worry about drivers like in Windows.

    Instructions

    First, make a folder named "android" (no quotes of course :)) You can place it anywhere on your hard drive, it doesn't really matter. Put it somewhere you'll easily remember, because you're going to be using it a LOT. I placed mine on my desktop.
    ScreenShot2012-10-02at42205PM.png


    Next, you'll want to download the android SDK from Here. (you won't need to install Java first like you would on a Windows PC, though I would recommend it anyway)
    (As pointed out by Wlmeng11, you could skip this step just download a zip that I will have attached at the bottom of the page containing the adb and fastboot files instead of downloading the whole SDK)
    ScreenShot2012-10-02at42257PM.png


    When the SDK finishes downloading, Unzip it and the contents of the "android-sdk-mac_x86" folder into your android folder.

    Once you have done that, open your android folder. Go into the tools folder inside of it. Double click on the file called "android" (possibly called android sdk) This file is a UNIX executable and will open within a Terminal window.
    ScreenShot2012-10-02at42232PM.png


    When it finishes opening, check the folder called tools. Make sure both "Android SDK Tools" and "Android SDK Platform-tools" are selected within the tools folder. Click install and wait for them to download.
    ScreenShot2012-10-02at42242PM.png


    When they finish downloading, go into the platform-tools folder inside your android folder, then copy adb and fastboot and paste them into the root of your android folder.
    ScreenShot2012-10-02at42733PM.png


    Now that you have adb and fastboot installed, we're going to want to test them to make sure they work.

    Go ahead and plug in your android device at this time. Make sure android debugging is enabled in settings. Go into Settings > Apps > Developer and check it there (for Gingerbread 2.3 and lower) or go into Settings > Developer Options and check it there for Ice Cream Sandwich or Jellybean. As of now, there are two ways to access adb and fastboot.

    Open a Terminal window (look in Applications > Utilities if you can't find it). Type "cd" followed by the path you saved your android folder to (I'm going to use the Desktop for this demonstration) it should look like this
    Code:
    cd /Users/<yourusername>/Desktop/android
    ScreenShot2012-10-02at43423PM.png


    Press enter.
    ScreenShot2012-10-02at43424PM.png


    Now you need to actually execute an adb or fastboot command. To do this, you'll need to type "./adb (or fastboot) <command>" For this tutorial, we will use "ADB devices" since it doesn't actually do anything to the phone. (we won't use fastboot since it requires rebooting to the boot loader which is different for every device)

    In the same terminal window as before type the following:
    Code:
    ./adb devices
    then hit enter. It should turn up your device's serial number. If it does, proceed to the next step, if not recheck your steps, then leave a post in this thread.
    ScreenShot2012-10-02at44100PM.png


    (if it says * daemon not running. starting it now on port 5037 *
    * daemon started successfully * that is perfectly normal)

    Now, at this moment, ADB and Fastboot are both completely useable. However, it's very annoying to have to CD into the directory and use ./ in front of every terminal command. I'll show you how to add it to your path so you don't have to do any of that.

    Open a new Terminal window and type
    Code:
    nano ~/.bash_profile

    it will open a window that looks like this:
    ScreenShot2012-10-02at44356PM.png

    (Yours will probably be blank, because I've added a lot of stuff to mine over the years)

    Add a line to it that contains the path to your android folder. (again, I'm using Desktop) It should look like this
    Code:
    export PATH=${PATH}:/Users/<yourusername>/Desktop/android
    ScreenShot2012-10-02at44544PM.png


    Once you have added that, press CTRL+X to exit, then Y to confirm the save then press enter. It will close the nano editor. You can close the Terminal window now.

    Now we need to verify that it works. Open a new Terminal window and type
    Code:
    adb devices
    If it shows the serial number, then you have set it up successfully and are good to go!
    ScreenShot2012-10-02at44817PM.png


    If you have any questions or issues let me know in the thread below.

    If this has helped, please press thanks!

    Awesome! This made the front page of XDA :) Thanks guys!
    24
    Added screenshots :)
    7
    So... Macs are Impersonal Computers?

    ---------- Post added at 06:24 PM ---------- Previous post was at 06:17 PM ----------

    Nice guide though btw

    Lol I'll fix that. Thanks btw. I'm out today, but I'll give you one tomorrow (too lazy to use my phone)
    4
    you won't need to install Java first like you would on a PC

    So... Macs are Impersonal Computers?

    ---------- Post added at 06:24 PM ---------- Previous post was at 06:17 PM ----------

    Nice guide though btw
    4
    To save time, you might want to just have a adb/fastboot combo instead of the entire sdk.
    (BTW it's tomorrow :p)

    Sent from my HTC Rezound

    Maybe, I actually use other parts of the SDK ;). Ill look into that though