How to install and set up adb on macOS
Codemia Knowledge Hub ·
The quickest way to install ADB (Android Debug Bridge) on a Mac is Homebrew: run brew install android-platform-tools, then check it with adb version.
You need:
- A Mac running macOS.
- A USB cable for your Android device.
- Developer options and USB debugging enabled on the Android device.
Step 1: Install Homebrew
Homebrew is a package manager for macOS. If you do not have it, open Terminal and run:
Step 2: Install adb
This installs the platform tools, including adb. Verify the installation:
It prints the installed adb version.
Step 3: Connect your Android device
Connect the device with a USB cable. If the device asks you to authorize USB debugging, tap "OK" to allow your Mac to debug it.
Step 4: Check that adb sees the device
This lists all connected devices. If yours is missing, check the USB cable, USB debugging and driver installation.
Step 5: Run adb commands
Install an app from your Mac on the connected device:
Transfer files, run shell commands or read device logs:
- To transfer files:
- To execute shell commands:
- To view logcat:
| Command | Description |
adb version | Displays the adb version installed on your Mac |
adb devices | Lists all connected devices |
adb install <file.apk> | Installs APK on the connected device |
adb push/pull <file> | Transfers files to/from the device |
adb shell <command> | Executes shell command on the connected device |
adb logcat | Displays log data from the device |
Updating adb
Keep adb current through Homebrew:
Connecting over Wi-Fi
- Connect the device over USB and confirm it shows up in
adb devices. - Set the device to listen on TCP/IP port 5555:
- Find the device IP address under Settings > About phone > Status.
- Connect to the device:
Related reading
- setBackground vs setBackgroundDrawable Android
- setNeedsLayout vs. setNeedsUpdateConstraints and layoutIfNeeded vs updateConstraintsIfNeeded
- setTimeout in React Native
- Setting action for back button in navigation controller
- Setting Precedence of Multiple ControllerAdvice ExceptionHandlers
- Setting PublicationMonitor.ConnectionContext throws a NullReferenceException
- Setting alpha on UIView sets the alpha on its subviews which should not happen
- Setting an image for a UIButton in code
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.