Install ADB & Fastboot on Mac OS X for HTC One
In this article
This guide shows you how to install ADB (Android Debug Bridge) and Fastboot on a Mac, then use them to send commands to your HTC One. You'll be able to unlock the bootloader, flash recoveries, sideload updates, and more. You'll need a Mac running macOS (any recent version), your HTC One, and a USB cable.
What You'll Need
- A Mac running macOS (10.10 or later is fine).
- Your HTC One (any variant, e.g., M7, M8, M9) with a charged battery.
- A USB cable that supports data transfer (not just charging).
- Internet connection to download the platform tools.
- On your phone: enable Developer options and USB debugging (Settings > Developer options > USB debugging). If you don't see Developer options, go to Settings > About > Software information, then tap “Build number” 7 times.
Step-by-Step
- Download the platform-tools. Go to the official Android developer site (developer.android.com/studio/releases/platform-tools) and download the macOS zip file. It’s a small download (~5 MB).
- Extract the zip. Double-click the downloaded zip to unzip it. You’ll get a folder named
platform-tools. Move it to a convenient location like your Home folder or Desktop. - Open Terminal. Go to Applications > Utilities > Terminal (or use Spotlight with Cmd+Space and type “Terminal”).
- Navigate to the platform-tools folder. In Terminal, type
cdfollowed by a space, then drag theplatform-toolsfolder onto the Terminal window. Press Enter. Your prompt should now show the path to that folder. - Verify ADB is working. Type
./adb versionand press Enter. You should see something like “Android Debug Bridge version 1.0.41”. If you get a “command not found” error, you’re in the wrong directory. - Connect your HTC One to your Mac. Use the USB cable. On your phone, when prompted, allow USB debugging (check “Always allow from this computer” and tap OK).
- Check that your phone is detected. In Terminal, type
./adb devices. You should see a device listed with “device” next to it. If it says “unauthorized”, check your phone and accept the debugging prompt. If it says “offline”, unplug and replug the cable. - Send a test command. Type
./adb shell echo helloand press Enter. You should see “hello” printed in Terminal. That confirms ADB is fully working. - Reboot into bootloader (fastboot mode). Type
./adb reboot bootloaderand press Enter. Your phone will restart into the bootloader (a screen with a menu and a phone icon). - Verify fastboot is working. In the bootloader, your phone is now in fastboot mode. Type
./fastboot devices. You should see your device listed with “fastboot” next to it. If not, you may need to install the HTC USB driver on your Mac (unlikely, as macOS usually has native support). - Send fastboot commands. For example, to unlock the bootloader (if you haven’t already), type
./fastboot oem unlockand follow the on-screen instructions. To flash a recovery image, type./fastboot flash recovery recovery.img(replacerecovery.imgwith the actual filename). To reboot normally, type./fastboot reboot.
Common Mistakes
- Using the wrong USB port or cable. Some USB ports (like on keyboards or hubs) may not pass data. Use a direct port on your Mac and a cable known to work for data.
- Not enabling USB debugging. Without it, ADB won’t see your device. Double-check that Developer options are on.
- Typing commands without the
./prefix. On macOS, you need to run binaries from the current directory with./. If you forget it, you’ll get “command not found”. - Forgetting to accept the RSA fingerprint prompt. The first time you connect, your phone asks to allow debugging from your computer. If you miss it, ADB will show “unauthorized”.
- Using a different version of fastboot. Some HTC One models are picky about fastboot versions. If you get “FAILED (remote: not allowed)”, try using an older or newer platform-tools version.
Tips
- Make a backup of your phone’s data before using any fastboot command that modifies partitions (like flashing a recovery or boot image).
- Keep the platform-tools folder in a permanent location (like
~/platform-tools) and add it to your PATH if you plan to use ADB often. To add to PATH, edit your~/.bash_profileor~/.zshrcand add:export PATH=$PATH:~/platform-tools. - If you get a “device not found” in fastboot, try disconnecting and reconnecting the USB cable, or restarting your phone into bootloader manually (power off, then hold Volume Down + Power).
- Use
./fastboot getvar allto see detailed info about your device (model, CID, etc.) – useful before flashing.
Troubleshooting
ADB says “unauthorized”. Unplug the cable, on your phone go to Developer options and tap “Revoke USB debugging authorizations”, then reconnect and accept the prompt.
ADB says “device offline”. Try a different USB cable, restart your phone, and restart the ADB server with ./adb kill-server then ./adb start-server.
Fastboot doesn’t see your device. Make sure you’re actually in bootloader mode (the screen with the menu). On some HTC One models, you need to select “FASTBOOT” from the bootloader menu using the volume keys and press Power. Also try ./fastboot devices with the phone connected.
Commands fail with “FAILED (remote: not allowed)”. This usually means the bootloader is locked or the command is not permitted. For unlocking, you must first run ./fastboot oem unlock (this will wipe your phone). For flashing, ensure you have an unlocked bootloader.
macOS blocks the tools because they’re from an unidentified developer. Right-click the adb or fastboot file in Finder, select “Open”, and confirm you want to run it. Alternatively, go to System Preferences > Security & Privacy and click “Allow Anyway”.
You get “command not found” even with ./. Check that you are in the correct directory by typing pwd and ls to see the files. If you don’t see adb and fastboot, you’re in the wrong folder.
Frequently Asked Questions
Do I need to unlock the bootloader to use fastboot?
Yes, for most flashing commands (like flashing a recovery or boot image), your bootloader must be unlocked. Unlocking wipes your phone, so back up first.
Will this work on any HTC One model?
Yes, the process is the same for all HTC One variants (M7, M8, M9, etc.), but some commands (like oem unlock) may differ slightly. Check your specific model’s XDA or HTC support page for exact commands.
Can I use ADB over Wi-Fi?
Yes, but it requires initial USB setup. After connecting via USB, run ./adb tcpip 5555, then disconnect and use ./adb connect . However, for fastboot, USB is required.
Is it safe to run these commands?
ADB commands are safe if you know what they do. Fastboot commands that flash partitions can brick your phone if you use the wrong image. Always double-check filenames and follow official guides.
What if I don’t have a Mac but a Windows PC?
This guide is Mac-specific. For Windows, you’ll need to download the Windows platform-tools and install HTC USB drivers. The commands are identical but with adb.exe and fastboot.exe.
Can I undo a bootloader unlock?
Yes, you can relock it with ./fastboot oem lock, but this will also wipe your phone. Note that relocking may not restore warranty status.