Slightly off schedule, Google has released the Android P Developer Preview 4 / Beta 3. We’re still digging into the update to see what’s new, but here’s how to manually install Android P DP4 on your Google Pixel, Pixel XL, Pixel 2, or Pixel 2 XL…
Amazon Kindle Paperwhite
Before we get started, we need to make sure that your device is visible to your computer. Type the command adb devices in the built-in Terminal (macOS/Linux) or Command Prompt (Windows) app; if you see your device listed, you’re ready to go. If not, make sure your device has ADB debugging turned on in Settings. We have an Android Basics tutorial here that will walk you through getting into the Developer Options if you need help.
Unlock the bootloader
If you know that your device is already unlocked, feel free to skip this step. Otherwise, you need to make sure your phone’s bootloader is unlocked before you can flash a factory image.
Bootloader unlocking is a security feature that requires that your device is completely wiped when going from a “locked” state to an “unlocked” state. For this reason, there’s no way to keep your data if your bootloader is locked.
If you need to unlock your bootloader, go to the Settings app, tap on the System option, and head to Developer options (if you don’t see Developer options, go to About phone and tap the Android build number several times). Make sure that OEM unlocking is toggled on.
Next, use the command adb reboot bootloader to go to the device’s bootloader and check if your device is in the locked state. If the bootloader on your Pixel device is locked, make sure your device is at the bootloader screen and use the fastboot oem unlock command. If that didn’t work or you have a Pixel 2 XL, you will need to use the fastboot flashing unlock_critical command.
After this, you’ll see some prompts on your device to confirm that you do indeed want to unlock your bootloader. After you confirm this, your device is going to be completely wiped, and you’ll be ready to move on with this guide.
Download and prepare the factory image
If you haven’t already, grab the Android P Developer Preview 4 build for your device from Google’s preview factory image page. Once you’ve downloaded the compressed file, extract it.
Inside the extracted compress file there will be a .zip file titled something like “taimen-ppp3.180510.008-factory-4ec49e55.zip” (Pixel 2 XL), and after you extract that file, you’ll find the bootloader, OS image, vendor image, and a radio image.
Not recommended: modify the “flash-all” script to save your data
You only need to follow these instructions if your device already had an unlocked bootloader and you want to keep your data. Otherwise, the flash will format your device and all data will be lost. If your bootloader is locked, your data will have to be wiped anyway as described above. If you don’t want to lose your data, in this case, you need to restart your device and back it up manually.
We do not recommend doing this since it could cause bugs in the operating system. If that doesn’t sway you, keep reading…
The “flash-all” script contains all of the commands necessary to flash the factory image onto your device. Before running it from the command line, you might want to remove the flag that wipes your data (although this isn’t ideal, you might run into problems especially if it’s a major upgrade).
In the file you extracted you’ll find two flash-all scripts as mentioned above. The flash-all script with the .bat extension works with the Windows command line while the .sh extension works with the Unix command line (macOS, Linux, etc.). Open up the proper flash-all script with your favorite text editor and remove the -w from the file. -w is an ADB flag which wipes all of the user data (the stuff we want to keep).
Once you’ve made the change, save your file, and open up a command-line program.
Run the script and install Android P DP4
As we did earlier to check unlock status, you need to boot into your bootloader to flash the factory image. Execute the command adb reboot bootloader again to get there. Alternatively, you could start up the device while holding the volume down and power keys simultaneously to boot into the bootloader.
Now point your command line to the file directory with the flash-all script. (Ex: cd /Users/<yourusername>/Downloads/taimen-ppp3.180510.008-factory-4ec49e55). For more help on using the command line, see this cheat sheet.
Once you’ve pointed to the correct directory, run your script.
- On Unix/Mac, run “./flash-all.sh”
- On Windows, run “flash-all.bat”
Now you should see the script running on-screen. It can take up to a little over five minutes for the image to install. Once the image is installed, the script will automatically reboot your phone. The first boot usually takes a while so you might have to wait about 10 minutes before assuming you’ve entered a bootloop.
Some users have had issues with the flash-all script not working on some devices. If that’s the case for you, you’re going to need to flash all of the images manually. It’s not a laborious process, though, and only requires a few extra steps. Make sure your device is in the proper bootloader state, and then follow these instructions:
First, flash the bootloader, reboot, next radio, and then reboot the bootloader again:
fastboot flash bootloader <bootloader file name here>.img
fastboot flash radio <radio file name here>.img
Flash the image:
fastboot flash -w update <image file name here>.zip
Reboot your device if it doesn’t happen automatically:
After the device boots, you should have Android P DP4 and, if you opted to modify the flash-all script, all of your data should be intact.
Note #1: When you manually flash the Developer Preview, you won’t receive future OTA updates from Google. When new builds come out, you’ll have to manually flash the update or wipe the Pixel and sign up for stable builds.
Note #2: There are two other ways to install Android P on your Pixel. First, you can sign up for the Beta program and have the update get sent to your device via OTA updates. The other option is if you already have Developer Preview 3 installed. This route allows you to manually flash the OTA file onto your handset.
Note #3: This guide assumes you already have the ADB tools installed on your computer. If you need the ADB tools, head over and download the Android SDK, and if you haven’t already unlocked your bootloader, keep reading.
We also recommend you download and install the Universal ADB Drivers from ClockWorkMod if you’re on Windows. This just makes it much easier than trying to rely on the drivers already on your computer.