Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install Android 9.0 Pie on Pixel Using a Mac

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through installing Android 9.0 Pie on a Google Pixel (Pixel, Pixel XL, Pixel 2, or Pixel 2 XL) using a Mac. You’ll flash the official factory image, which wipes your device and installs a clean, stock version of Pie. This is useful if you want to downgrade from a newer version, recover from a soft-brick, or simply start fresh. You’ll need a Mac, a USB cable, and about 30 minutes.

What You'll Need

  • A Google Pixel, Pixel XL, Pixel 2, or Pixel 2 XL (the steps work for all of these).
  • A Mac running macOS (any recent version).
  • A USB cable that supports data transfer (not just charging).
  • Android Platform Tools (ADB and Fastboot) installed on your Mac.
  • The Android 9.0 Pie factory image for your specific Pixel model, downloaded from Google’s official developer site.
  • A backup of any important data on your phone – flashing will erase everything.

Step-by-Step

  1. Back up your phone. Go to Settings > System > Backup on your Pixel and make sure backup is on. Also copy any photos or files you want to keep to your Mac or cloud storage. Flashing wipes the device completely.
  2. Install Android Platform Tools on your Mac. Download the official “Android Studio” or just the “Platform Tools” zip from the Android developer website. Unzip it to a folder, for example ~/platform-tools. Open Terminal and navigate to that folder: cd ~/platform-tools.
  3. Enable Developer Options on your phone. On your Pixel, go to Settings > About phone and tap “Build number” seven times. You’ll see a message that developer mode is enabled.
  4. Enable USB debugging and OEM unlocking. Go to Settings > System > Developer options and turn on both “USB debugging” and “OEM unlocking”. If OEM unlocking is greyed out, you may need to insert a SIM card and have an internet connection.
  5. Connect your phone to your Mac. Use a USB cable. On your phone, a prompt will appear asking to allow USB debugging – check “Always allow from this computer” and tap OK.
  6. Verify ADB connection. In Terminal, run adb devices. You should see your device listed with “device” status. If it shows “unauthorized”, check the phone screen and accept the prompt.
  7. Download the factory image. Go to Google’s “Factory Images for Nexus and Pixel” page. Find your device model (e.g., “sailfish” for Pixel, “marlin” for Pixel XL, “walleye” for Pixel 2, “taimen” for Pixel 2 XL). Click the link for Android 9.0 (API 28) and download the zip file. Do not download a beta or a newer version.
  8. Unzip the factory image. Double-click the downloaded zip to unzip it. Inside, you’ll find another zip file (e.g., sailfish-ppr1.180610.009.zip). Unzip that one too. You’ll get a folder containing files like flash-all.sh, flash-base.sh, and several .img files.
  9. Boot your phone into bootloader mode. In Terminal, run adb reboot bootloader. Your phone will restart into the bootloader screen (also called fastboot mode). You’ll see an Android robot with “Start” written on it.
  10. Unlock the bootloader (first time only). If your bootloader is locked, you must unlock it. In Terminal, run fastboot flashing unlock. On your phone, use the volume keys to select “Unlock the bootloader” and press the power button. This wipes your phone again. If your bootloader is already unlocked, skip this step.
  11. Run the flash script. In Terminal, navigate to the folder where you unzipped the factory image (e.g., cd ~/Downloads/sailfish-ppr1.180610.009). Then run ./flash-all.sh. The script will flash the bootloader, radio, and system images. It may take several minutes. Do not unplug your phone during this process.
  12. Wait for the phone to reboot. The script will automatically reboot your phone when done. The first boot can take up to 10 minutes. You’ll see the Android setup screen when it’s ready.
  13. Re-lock the bootloader (optional but recommended). After the phone boots, you can re-lock the bootloader for security. Reboot to bootloader again (adb reboot bootloader), then run fastboot flashing lock. Confirm on the phone. This wipes your phone again, so do it before you set up your data.
  14. Set up your phone. Follow the on-screen setup. Restore your backup if you want.

Common Mistakes

  • Wrong factory image. Each Pixel model has a different image. Flashing the wrong one will fail. Double-check your model (Settings > About phone > Model).
  • Not enabling OEM unlocking. If you skip this, the fastboot flashing unlock command will fail with an error.
  • Using a charging-only cable. Some USB cables don’t carry data. Use the cable that came with your phone or a known good one.
  • Interrupting the flash. Unplugging the phone or closing Terminal mid-flash can brick your device. Let it finish.
  • Forgetting to backup. Flashing erases everything. If you didn’t backup, your data is gone.

Tips

  • Make sure your Mac’s battery is fully charged or plugged in during the process.
  • If you get a “permission denied” error when running ./flash-all.sh, run chmod +x flash-all.sh first.
  • Keep the Terminal window open and watch the progress. The script prints each step.
  • If you’re on macOS Catalina or newer, you may need to give Terminal permission to access the folder where you unzipped the files (System Preferences > Security & Privacy > Privacy > Files and Folders).
  • After flashing, you can re-lock the bootloader to keep your device secure. Do this before you start using the phone.

Troubleshooting

If the flash fails or the phone doesn’t boot, try these in order:

  1. Check the connection. Run adb devices and fastboot devices to ensure your phone is recognized. If not, try a different USB port or cable.
  2. Restart your Mac and phone. Reboot both, then start again from step 9.
  3. Re-download the factory image. The zip may be corrupted. Delete and download again.
  4. Manually flash each image. If the script fails, you can flash manually. In bootloader mode, run the following commands one by one (replace sailfish with your device codename):
    fastboot flash bootloader bootloader-sailfish-xxxx.img
    fastboot reboot-bootloader
    fastboot flash radio radio-sailfish-xxxx.img
    fastboot reboot-bootloader
    fastboot flash system system.img
    fastboot flash vendor vendor.img
    fastboot flash boot boot.img
    fastboot flash cache cache.img
    fastboot flash userdata userdata.img
    fastboot reboot
  5. If the phone is stuck in a boot loop, boot into recovery mode (hold Power + Volume Down, then select “Recovery mode”) and do a factory reset from there. This wipes data but often fixes boot issues.
  6. If the phone won’t turn on at all, try charging it for 30 minutes, then hold Power + Volume Down for 10 seconds to force a reboot into bootloader.

Frequently Asked Questions

Will this work on a Pixel 3 or newer?

No, this guide is specifically for the original Pixel, Pixel XL, Pixel 2, and Pixel 2 XL. Newer Pixels (3 and later) have different factory images and may not support Android 9.0 Pie (they came with 10 or later).

Do I need to unlock the bootloader every time?

No, once unlocked, it stays unlocked until you re-lock it manually. However, flashing a factory image does not re-lock it.

Will I lose my photos and apps?

Yes, flashing erases the phone’s internal storage. Photos backed up to Google Photos will be restored, but local files will be gone. Make sure you back up before starting.

Can I go back to a newer Android version after this?

Yes, you can flash any official factory image for your device, including newer Android versions, using the same process.

Is this the same as an OTA update?

No, this is a full factory image flash. It wipes your data and installs the system from scratch. An OTA update preserves your data.

What if I get a “fastboot: command not found” error?

This means fastboot is not in your PATH. Run the command with the full path, e.g., ~/platform-tools/fastboot, or add the platform-tools folder to your PATH in Terminal.