Mobile Dev

Install ADB on macOS: Complete Beginner's Terminal Setup Guide

Learn how to install ADB (Android Debug Bridge) on macOS for terminal usage. Complete beginner's guide covering Homebrew and manual installation, USB debugging setup, and essential commands.

1 answer 1 view

How to install ADB (Android Debug Bridge) on macOS for terminal usage? What are all the required steps for a complete beginner’s tutorial to set up ADB on macOS?

Installing ADB (Android Debug Bridge) on macOS enables you to control Android devices directly from your terminal, making it essential for app development, device testing, and file management. You can install ADB using Homebrew for automatic updates or manually by downloading Google’s platform-tools, with both methods requiring PATH configuration and USB debugging setup on your Android device. This complete beginner’s guide covers all installation methods, configuration steps, and essential commands to get you started with ADB on macOS.


Contents



What is ADB and Why Install It on macOS?


Android Debug Bridge (ADB) is a versatile command-line tool that lets you communicate with an Android emulator instance or connected Android device. Think of ADB as the ultimate remote control for your Android device—except instead of buttons, you type commands that can install apps, transfer files, access the device shell, run powerful diagnostics, and even modify system files. For macOS users, ADB installation opens up a world of possibilities for developers, power users, and anyone who wants to go beyond the basic touch interface.

Why would you want ADB on your Mac? Picture this: you can automate app installations across multiple devices, debug your own Android apps directly from your Mac’s terminal, back up specific app data without root access, or even unlock hidden features on your device. The flexibility and power that ADB brings to macOS users makes it an indispensable tool for anyone working with Android technology. And the best part? Once installed correctly, ADB works seamlessly from any directory in your terminal—no need to navigate to specific folders every time.


Prerequisites for ADB Installation


Before diving into ADB installation, let’s make sure you have everything needed for a smooth setup process. First and foremost, you’ll need a macOS device—whether it’s a MacBook, iMac, or Mac mini doesn’t matter as long as it’s running macOS 10.10 (Yosemite) or later. The newer your macOS version, the better the compatibility with the latest ADB tools.

You’ll also need an Android device that supports USB debugging mode. This feature is enabled in the Developer Options, which might be hidden on newer Android versions. Don’t worry, we’ll cover how to unlock it later in this guide. Your Android device should be running Android 4.2 (Jelly Bean) or higher—virtually all devices from the last decade meet this requirement.

Internet connection is essential for downloading either Homebrew (if you choose that method) or the Google platform-tools package. A stable USB cable to connect your Android device to your Mac is also required—preferably the original cable that came with your device, as third-party cables can sometimes cause connection issues.

Finally, make sure you have some basic familiarity with the macOS Terminal. You don’t need to be a command-line expert, but knowing how to open Terminal, navigate directories, and run commands will make the ADB installation process much smoother. If you’ve never used Terminal before, don’t worry—it’s surprisingly user-friendly, and we’ll walk through each step.


Method 1: Installing ADB Using Homebrew


The easiest and most popular way to install ADB on macOS is through Homebrew, the package manager that makes software installation as simple as typing a single command. If you already have Homebrew installed, this method will take you from zero to ADB-ready in about five minutes. If not, the setup process still takes less than ten minutes and will save you hours of manual updates in the future.

Installing Homebrew (If You Don’t Have It)

First, open Terminal—you can find it in Applications > Utilities, or simply press Command+Space to open Spotlight and type “Terminal”. In the Terminal window, paste the following command and press Enter:

bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This single command downloads and installs the entire Homebrew package manager. You’ll be prompted for your password—this is normal for system installations on macOS. The installation process might take a few minutes as it downloads and sets up all the necessary components.

Once Homebrew is installed, you might need to add it to your PATH. For Apple Silicon Macs (M1/M2/M3), run:

bash
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
eval "$(/opt/homebrew/bin/brew shellenv)"

For Intel-based Macs, use:

bash
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zshrc
eval "$(/usr/local/bin/brew shellenv)"

Installing ADB with Homebrew

Now comes the magic moment. With Homebrew ready, installing ADB is as simple as:

bash
brew install android-platform-tools

This single command downloads and installs the latest ADB package along with Fastboot and other essential Android tools. Homebrew automatically handles dependencies and ensures you get the most up-to-date version. The installation typically takes 1-3 minutes depending on your internet speed.

What makes this method so powerful? Homebrew automatically updates ADB when new versions become available. Simply run brew upgrade android-platform-tools occasionally to keep your tools current. No more manual downloads or version chasing—Homebrew handles everything behind the scenes.


Method 2: Manual Installation of ADB


While Homebrew offers convenience, some users prefer manual installations for greater control or when they can’t use package managers. The manual method involves downloading Google’s official platform-tools directly and configuring them yourself. Don’t worry—it’s straightforward once you know the steps.

Downloading Platform-Tools

First, navigate to the official Android Developer website to download the platform-tools package. The direct URL for the latest macOS version is typically:

https://dl.google.com/android/repository/platform-tools-latest-darwin.zip

You can download this file using your browser, or use curl in Terminal:

bash
cd ~/Downloads
curl -O https://dl.google.com/android/repository/platform-tools-latest-darwin.zip

This downloads the ZIP file to your Downloads folder. The filename will look something like platform-tools-latest-darwin.zip or include a version number like platform-tools-34.0.4-darwin.zip.

Extracting the Files

Next, extract the ZIP file using either the Archive Utility (double-click the ZIP file) or Terminal:

bash
unzip platform-tools-latest-darwin.zip

This creates a platform-tools folder containing the ADB and Fast executables. For better organization, move this folder to your home directory:

bash
mv platform-tools ~/

Now you have ADB installed at ~/platform-tools/—but there’s one crucial step left before you can use it from any directory.

Adding ADB to Your PATH

The PATH environment variable tells your Terminal where to look for executable programs. By adding the platform-tools directory to your PATH, you can run adb and fastboot commands from any folder without typing the full path.

To add ADB to your PATH permanently, open your shell configuration file. For macOS Catalina (10.15) and later, Zsh is the default shell:

bash
echo 'export PATH=$PATH:~/platform-tools' >> ~/.zshrc
source ~/.zshrc

For older systems using Bash:

bash
echo 'export PATH=$PATH:~/platform-tools' >> ~/.bash_profile
source ~/.bash_profile

These commands add the platform-tools directory to your PATH and immediately apply the changes. Now try running adb version from any directory—you should see the ADB version information instead of a “command not found” error.

The manual method gives you complete control over where ADB is installed and which version you’re using. It’s perfect for developers who need specific versions or prefer managing their tools without package managers.


Configuring ADB on macOS


After installing ADB through either method, there are several configuration steps that will make your ADB experience smoother and more secure. These configurations aren’t strictly necessary for basic ADB usage, but they’ll save you headaches in the long run.

Setting Up udev Rules (Optional but Recommended)

On Linux systems, udev rules handle device permissions automatically. While macOS doesn’t use udev, you can create similar functionality by setting up a symbolic link or using a configuration file. This step helps avoid permission issues when connecting multiple Android devices.

First, create a configuration file:

bash
sudo mkdir -p /etc/udev/rules.d
sudo nano /etc/udev/rules.d/51-android.rules

Add the following lines to the file (you can exit nano with Control+X, then Y to save):

SUBSYSTEM=="usb", ATTR{idVendor}=="*", MODE="0666", GROUP="wheel"

Save the file and update udev rules:

bash
sudo udevadm control --reload-rules
sudo udevadm trigger

Configuring Android Auto-USB

To prevent your Android device from constantly asking “Allow USB debugging?” every time you connect it, you can enable “Always allow from this computer” on the USB debugging permission dialog. This saves you from repeatedly tapping “Allow” during development sessions.

For production environments or shared computers, consider setting up ADB keys for secure authentication. This prevents unauthorized devices from debugging your Android devices:

bash
adb keygen ~/.android/adbkey
adb start-server

Optimizing Terminal Experience

To make ADB commands easier to use, consider creating aliases in your shell configuration file. For Zsh users, add these to ~/.zshrc:

bash
alias adbs="adb shell"
alias adbls="adb shell ls"
alias adblog="adb logcat"
alias adbusb="adb usb"
alias adbwifi="adb tcpip 5555"

With these aliases, you can type adbs instead of adb shell, adblog for logcat output, and so on. These shortcuts save typing time and make ADB workflows more efficient.


Setting Up USB Debugging on Android


Installing ADB on your Mac is only half the battle—you also need to configure your Android device to accept connections from ADB. This process involves enabling Developer Options and turning on USB Debugging mode. The exact steps vary slightly between Android versions, but the general process remains consistent.

Enabling Developer Options

Developer Options is a hidden menu in Android that contains advanced settings and debugging tools. To unlock it:

  1. Open Settings on your Android device
  2. Scroll to “About phone” or “About device”
  3. Find “Build number” (usually at the bottom)
  4. Tap “Build number” seven times rapidly
  5. You’ll see a “You’re now a developer!” message when done

Some manufacturers hide Developer Options in different locations. If you don’t find it under “About phone,” look in System > Developer options or check your device’s specific documentation.

Enabling USB Debugging

Once Developer Options is enabled, follow these steps:

  1. Go back to Settings > Developer options
  2. Find “USB Debugging” and toggle it on
  3. Connect your Android device to your Mac using a USB cable
  4. When the “Allow USB debugging?” dialog appears, check “Always allow from this computer”
  5. Tap “Allow”

The “Always allow from this computer” option is crucial—it prevents the permission dialog from appearing every time you connect your device. For security reasons, only enable this on trusted computers and networks.

Wireless ADB Setup (Optional)

For a completely wireless experience, you can set up ADB over Wi‑Fi. First, connect your device via USB once to authorize the connection, then run:

bash
adb tcpip 5555
adb connect [device-ip-address]:5555

To find your device’s IP address, go to Settings > About phone > Status, or use adb shell ip addr show wlan0 from ADB. Once connected, you can disconnect the USB cable and continue using ADB wirelessly.


Verifying ADB Installation


After completing the installation and configuration steps, it’s time to verify that everything is working correctly. This verification process ensures that your Mac can communicate with your Android device and that all components are properly configured.

Checking ADB Version

The simplest verification is checking the ADB version. Open Terminal and type:

bash
adb version

If everything is installed correctly, you should see output similar to this:

Android Debug Bridge version 1.0.41
Version 34.0.4-10422323
Installed as /usr/local/bin/adb

The exact version numbers may vary depending on when you installed ADB, but the important thing is that you see version information instead of an error message.

Testing Device Connection

Next, connect your Android device to your Mac via USB. Make sure USB Debugging is enabled on your device and you’ve allowed debugging for your computer. Then run:

bash
adb devices

You should see your device listed as:

List of devices attached
emulator-5554	device

Or with a device ID:

List of devices attached
ABC12345678	device

The “device” status indicates that ADB has successfully connected to your Android device. If you see “unauthorized” instead, it means you haven’t allowed USB debugging on your device yet—simply disconnect and reconnect the USB cable, then tap “Allow” on the permission dialog.

Testing Basic ADB Commands

Try running a few basic commands to ensure everything works:

bash
adb shell pm list packages
adb shell settings get global airplane_mode_on
adb shell dumpsys battery

These commands should return information about installed packages, airplane mode status, and battery information respectively. If you see data instead of errors, your ADB installation is working perfectly.


Essential ADB Commands for Beginners


Once you have ADB installed and verified, it’s time to explore the most useful commands that will form the foundation of your ADB workflow. These commands cover file management, app installation, debugging, and system information—everything you need to get started.

Device Information Commands

Understanding your device’s status is crucial before performing operations. These commands provide valuable information:

bash
adb get-state # Shows device state (device, offline, unauthorized)
adb get-serialno # Displays device serial number
adb shell settings list system # Lists all system settings
adb shell dumpsys battery # Shows battery status and health
adb shell dumpsys meminfo # Displays memory usage information

These commands help diagnose issues, monitor device health, and understand system behavior during testing or development.

File Management Commands

Transferring files between your Mac and Android device is one of ADB’s most powerful features:

bash
adb push [local-file] [remote-path] # Copy file from Mac to device
adb pull [remote-file] [local-path] # Copy file from device to Mac
adb shell ls /sdcard/ # List files on device storage
adb shell rm /sdcard/file.txt # Delete file from device
adb shell mkdir /sdcard/newfolder # Create new directory

For example, to copy a photo from your Mac to your device’s Pictures folder:

bash
adb push ~/Downloads/photo.jpg /sdcard/Pictures/

App Management Commands

Installing and managing apps becomes effortless with ADB:

bash
adb install [app.apk] # Install app from APK file
adb install -r [app.apk] # Reinstall existing app
adb uninstall [package.name] # Remove app by package name
adb shell pm list packages # List all installed packages
adb shell pm list packages -3 # List only third-party apps

To install an app, simply download the APK file to your Mac and run:

bash
adb install ~/Downloads/app.apk

System Commands

These commands give you control over device settings and system functions:

bash
adb reboot # Restart device
adb reboot bootloader # Boot into bootloader
adb shell input keyevent 82 # Toggle screen on/off
adb shell input text "Hello World" # Type text on device
adb shell screenrecord /sdcard/record.mp4 # Record screen

The screen recording feature is particularly useful for creating tutorials or documenting issues.

Debugging Commands

For developers and power users, these commands are indispensable:

bash
adb logcat # View system logs
adb logcat -s ActivityManager # Filter logs for specific tags
adb shell dumpsys activity # Get activity manager information
adb shell am force-stop [package] # Force-stop an app
adb shell am start -n [package]/.[activity] # Launch specific activity

These commands help debug app issues, monitor system behavior, and control app execution flow.


Troubleshooting Common Issues


Even with perfect installation, you might encounter ADB issues. Don’t worry—most problems have straightforward solutions. Let’s tackle the most common issues macOS users face with ADB.

“Command Not Found” Error

If you see “adb: command not found” after installation, it means ADB isn’t in your PATH. For Homebrew installations, try:

bash
brew doctor
brew upgrade android-platform-tools

For manual installations, verify the PATH configuration:

bash
echo $PATH

Make sure ~/platform-tools or /usr/local/bin appears in the output. If not, re-add it to your shell configuration file as described earlier.

Device Not Showing in “adb devices”

When your device doesn’t appear in the device list, try these solutions:

  1. Check USB cable: Use the original cable and try different ports
  2. Enable USB debugging: Ensure Developer Options and USB Debugging are enabled
  3. Restart services: Run adb kill-server followed by adb start-server
  4. Check drivers: For some manufacturers, you might need additional drivers
  5. Try different modes: Some devices require “Transfer files” mode in USB connection settings

If you still see “unauthorized”, disconnect and reconnect the USB cable, then tap “Allow” on the device when prompted.

Permission Denied Errors

Permission errors typically occur when ADB doesn’t have proper access to device files or system commands. Try:

bash
adb shell settings put global adb_enabled 1
adb shell su -c "pm grant [package] android.permission.WRITE_EXTERNAL_STORAGE"

For persistent permission issues, consider setting up ADB keys as described in the configuration section.

Slow ADB Performance

If ADB commands are slow or unresponsive:

  1. Try different USB modes: Switch between “Transfer files” and “Transfer photos (PTP)”
  2. Disable USB power saving: In Developer Options, disable “USB configuration” or set to “Charge only”
  3. Use faster cable: Upgrade to a USB 3.0 cable or USB‑C to USB‑A adapter
  4. Reduce logcat verbosity: Use adb logcat *:S to disable all logging temporarily

ADB Server Issues

Sometimes the ADB server gets stuck in a bad state. Fix this by:

bash
adb kill-server
adb start-server

If the server won’t start, you might need to delete the ADB server files:

bash
rm ~/.android/adb*
adb start-server

For more complex issues, consider checking the official Android documentation or community forums where experienced ADB users often share solutions to rare problems.


Sources


  1. Android Debug Bridge (adb) Official Documentation — Comprehensive guide covering all installation methods and troubleshooting: https://developer.android.com/tools/adb
  2. CyberAdvisors ADB Installation Guide — Industry blog with practical Homebrew installation instructions and ADB workflow tips: https://blog.cyberadvisors.com/technical-blog/blog/android-debug-bridge-adb-guide
  3. MundoByBytes ADB Homebrew Tutorial — Complete guide focusing on Homebrew installation with security recommendations and troubleshooting: https://mundobybytes.com/en/Install-and-use-ADB-on-a-Mac-with-Homebrew/
  4. Esausilva Manual ADB Setup — Community tutorial with step-by-step manual installation instructions and PATH configuration: https://esausilva.com/2010/10/02/how-to-set-up-adb-android-debug-bridge-in-mac-osx/
  5. GadgetsToUse ADB Mac Guide — Industry leader with practical setup guide covering both Homebrew and manual methods: https://gadgetstouse.com/blog/2023/ PATH_TO_FIX/03/install-adb-on-mac-connect-android/

Conclusion


Installing ADB on macOS opens up tremendous possibilities for Android development, testing, and device management. Whether you choose the convenient Homebrew method or prefer manual installation for greater control, the process is straightforward with the right guidance. Remember to configure USB debugging on your Android device and verify the installation with basic commands before diving into more advanced usage.

The key to successful ADB usage lies in understanding both the installation process and the essential commands that form your daily workflow. With practice, you’ll find that ADB becomes an indispensable tool—whether you’re debugging apps, transferring files, or exploring your Android device’s capabilities beyond what the standard interface allows. By following this complete beginner’s tutorial, you’ve set yourself up for success with ADB on macOS and can now harness the full power of Android Debug Bridge from your terminal.

Authors
Verified by moderation
Moderation
Install ADB on macOS: Complete Beginner's Terminal Setup Guide