FORUMS
Remove All Ads from XDA

Guide: How To Unlock/Root/Flash for Pixel XL (Marlin)

4,067 posts
Thanks Meter: 10,633
 
By bajasur, Retired Forum Moderator on 27th November 2016, 02:39 AM
Post Reply Email Thread
How-To Guide For Beginners
Pixel XL (Marlin)

Intro

This thread will serve as a location for basic how-to guides for the Pixel XL (Marlin). I'm going to start off with a couple of the more obvious ones and go from there.

Prerequisites:

If you are on Verizon, please follow dePixel8 guidelines prior to using this thread

Always update your phone to the latest build available before starting the unlocking/rooting process.

You'll need a working adb/fastboot environment on your PC to get through some of these guides.

You must have Java installed and up to date in order to use the SDK Manager, please ensure that this is taken care of before installing the SDK.

Please do not install adb/fastboot via any means other than the Android SDK, using other tools (like Minimal adb & fastboot) can lead to an outdated setup and various problems with flashing. You've been warned, other tools will not be supported in this thread.


Go here to download the Android SDK, which will give you most updated version of adb and fastboot. Scroll to the bottom of the page and find Other Download Options>SDK Tools Only, and grab the right version for your OS. While it's downloading create a folder in C: called SDK (C:SDK). Once you've downloaded the zip you can extract it into your C:SDK folder. Navigate to C:SDKandroid-sdk-windows and open SDK Manager.exe. In SDK Manager you need to install the following packages:

Tools> Android SDK Tools, Android SDK Platform-tools
Extras> Android Support Library, Google USB Driver

Once you have installed those, inside C:SDK you should see some new folders, one of them will be called platform-tools, within that folder you should see fastboot.exe and adb.exe. I'll refer to this as your fastboot folder/directory or working folder/directory during this guide. To make sure adb is correctly installed, open a command prompt from within your fastboot folder (hold shift + right click, select open command prompt here) and issue this command:
Code:
adb version
If it returns a version number for Android Debug Bridge then you're good to go.

You can test adb by connecting your device to your PC while booted into Android (making sure that adb/usb debugging is enabled in Settings>Developer Options) with the screen unlocked and issuing this command:
Code:
adb devices
It should return your device serial number, if so, adb is working.

You can test fastboot by connecting your device to your PC while booted into the bootloader (power + volume down) and issuing this command:
Code:
fastboot devices
It should return your device serial number, if so, fastboot is working.

Quick Tips

How to boot into the bootloader:
Power off your device. Once it's powered off hold power + volume down and the phone will boot into the bootloader. You can also use the following adb command:
Code:
adb reboot bootloader
Index

Post #1
1. How To Unlock Your Bootloader
2. How To Install A Custom Recovery On Your Device
3. How To Root with TWRP Recovery
4. How To Root with via Fastboot (No Recovery)

Post #2
5. How To Install A ROM with TWRP Recovery
6. How To Install A Custom Kernel With TWRP Recovery
7. How To Install A Custom Kernel Using Fasboot
8. How To Flash The Factory Images (Return To Stock)
9. How To Flash The Factory Images (Return To Stock But Leaving Internal Storage Intact)

1. How To Unlock Your Bootloader
  • Go into Settings/About Phone, scroll down and click on “build number” continuously until you see a toast notification telling you that you've enabled Developer Options. Go back to your Settings menu and enter Developer Options, scroll down and click on the “Enable OEM Unlock” checkbox, also make sure you enable USB Debugging while you're in the Developer Options menu.
  • Power off your phone then boot into the bootloader (power + volume down).
  • Connect your phone to your PC via usb cable.
  • Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here).
  • Check your fastboot connection by issuing this command:

    Code:
    fastboot devices
    It should return your device serial number, if not you need to make sure your drivers are installed correctly.
  • Once you've confirmed your fastboot connection issue the unlock command:

    Code:
    fastboot flashing unlock
    This will erase all user data from the device!
  • You should now see a screen on your phone asking you to confirm this action, use the volume keys to scroll and the power key to confirm if you're sure you want to go ahead.
  • Allow the process to complete and then issue this command:

    Code:
    fastboot reboot
  • Allow everything to go ahead and once finished you can disconnect your usb cable.

Note: After unlocking your bootloader, each time your phone boots up you'll be greeted with a warning that says "Your device software can't be checked for corruption. Please lock the bootloader". This is nothing to worry about, it's normal to see this when you have an unlocked bootloader. You can't remove it, as long as your bootloader is unlocked it will stay there.

Important: do not relock your bootloader unless your phone is fully stock. You must flash the factory images first in order to remove root and custom recovery (if you have them), if this precaution isn't taken you may end up with a brick. Please see section 10 of this guide for full instructions on how to return to stock.



2. How To Install TWRP On Your Device

Prerequisites: unlocked bootloader (section 1).
  • Warning: TWRP is currently in RC1 phase and is not fully stable, flash at your own risk.
  • This guide assumes you have just unlocked your bootloader and are otherwise stock, NO root yet.
  • Download the necessary files (IMG and Zip) from the TWRP website and add the TWRP zip to your internal storage: https://dl.twrp.me/marlin/
  • Place the IMG file in your fastboot folder (this is where fastboot.exe is located on your PC)
  • Boot into the bootloader. Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here), enter this command:

    Code:
    fastboot boot path/to/twrp.img
    (The TWRP filename in the command will change depending on which recovery you're flashing)
  • This will temporarily boot TWRP on your device. If you are using a lockscreen pin/pattern/password and do not get prompted to enter your password, reboot to the bootloader and try again. Go to install and browse to the zip and install the TWRP zip

3. How To Root

Prerequisites: unlocked bootloader (section 1), TWRP recovery (section 2).
  • Download the latest SuperSU of your choosing to your phone:
    https://download.chainfire.eu/1013/S...1115184928.zip

  • Boot into TWRP recovery and enter the install menu.
  • Navigate to where you have SuperSU stored on your internal storage and select it.
  • Swipe to install.
  • Thats it, reboot and you should have TWRP and SuperSU installed

4. How To Root via Fastboot

Prerequisites: unlocked bootloader (section 1)
  • Special Note: This is for users who do not have or want TWRP installed and want to run stock root
  • Download Chainfire's root-marlin-pixelxl.zip located here: https://download.chainfire.eu/1011/C...in-pixelxl.zip
  • Extract Chainfire's zip and follow the instructions in the read me

    Code:
    ***** The short guide *****
    
    *BOOT* (do not flash!) the supplied image, and wait a few minutes:
    
    fastboot boot boot-to-root.img
    
    ***** The long guide *****
    
    Before you root your device, you need to unlock your bootloader, if you haven't done so yet.
    
    If you are using a Verizon device, you need a special tool for that. Go find that first.
    
    - Boot into Android
    - Enable developer options
    --- Settings -> About phone -> Build number: tap 7 times
    - Enable OEM unlocking
    --- Settings -> Developer Options -> OEM unlocking
    - Go into bootloader mode
    --- Turn off device
    --- Hold volume down and power
    - Run "fastboot flashing unlock" and follow the on-screen instructions
    --- This will wipe your device
    
    To root your device:
    
    - Go into bootloader mode, if not there already
    --- Turn off device
    --- Hold volume down and power
    - Run "fastboot boot boot-to-root.img"
    --- Wait for a few minutes. The device will reboot at least twice
    - You should be rooted once Android is fully booted up
    
    *****
    
    Enjoy!
    - Chainfire





XDA:DevDB Information
Guide: How To Unlock/Root/Flash for Pixel XL (Marlin), Tool/Utility for the Google Pixel XL

Contributors
bajasur, The Flash, beanstown106, @micmars

Version Information
Status: Testing

Created 2016-11-27
Last Updated 2016-11-26
The Following 56 Users Say Thank You to bajasur For This Useful Post: [ View ] Gift bajasur Ad-Free
 
 
27th November 2016, 02:45 AM |#2  
bajasur's Avatar
OP Retired Forum Moderator
Flag San Clemente
Thanks Meter: 10,633
 
Donate to Me
More
5. How To Install A ROM with TWRP Recovery

Prerequisites: unlocked bootloader (section 1), TWRP recovery (section 2).

Pending......

6. How To Install A Custom Kernel With TWRP Recovery

Prerequisites: unlocked bootloader (section 1), TWRP recovery (section 2).

A custom kernel can open up a new level of control over your device, such as overclocking/underclocking, undervolting, changing governors, changing I/O schedulers, adjusting colour calibrations, adjusting sound calibrations, and many other options.
  • Download a kernel that is compatible with your current ROM.
  • Check the md5 to verify its integrity.
  • Enter TWRP recovery.
  • Select the install option from the TWRP home screen.
  • Navigate to the kernel and select it.
  • Swipe to install.
  • You'll have an option to wipe cache/dalvik and an option to reboot system, hit the reboot system button.

Once your phone has booted up you can use a kernel tuning app to change governors, I/O scheduler, clock speed, and other options. Some of the popular kernel apps are Kernel Auditor, Trickster Mod, No Frills, Kernel Tuner, and many more.

7. How To Install A Custom Kernel via Fastboot

Prerequisites: unlocked bootloader (section 1)
  • This guide is for users who DO NOT have TWRP installed, and want to Fastboot flash custom kernels.
  • Check the md5 to verify its integrity.
  • Download the kernel file you want to flash from whichever kernel developer you'd like
  • Place the file in your fastboot folder
  • Open a command prompt within that folder and run

    Code:
    fastboot flash kernel kernel_binary
  • kernel_binary will be replaced with whatever the file name (ie fk-r5.gz for Franco's Kernel)
  • Reboot your device.
  • Special Note: You may lose root if you had SuperSU pre-installed, you will need to re root following Section 4 (How to Root via Fastboot)
The Following 18 Users Say Thank You to bajasur For This Useful Post: [ View ] Gift bajasur Ad-Free
27th November 2016, 02:45 AM |#3  
bajasur's Avatar
OP Retired Forum Moderator
Flag San Clemente
Thanks Meter: 10,633
 
Donate to Me
More
8. How To Flash The Factory Images (And Return To Stock)

Prerequisites: unlocked bootloader (section 1).

This section will explain how to return the phone to be like it was when it came out of the box. This will wipe everything from the phone. If you wish to flash the factory images without wiping your personal data from the internal storage please move on to the next section.
  • Download the appropriate factory images for your model https://developers.google.com/android/images
  • Unzip the marlin-xxxxxx-factory-xxxxxxxx (marlin-nmf26o-factory-4f68765c) into a directory on your PC (for this guide we'll use C:\marlin\).
  • Once unzipped you should have a folder named marlin-xxxxxx (marlin-nmf26o).
  • Move the contents of this folder into your Fastboot/ADB environment so that you can run fastboot and adb commands. (Note: I do the opposite and move the most current fastboot and ADB from the Android SDK into this folder)
  • Look for the windows batch file named "flash-all.bat" and double click on it. This should begin the proper full clean flash of all images back to stock. This should take a few minutes, but eventually your phone should reboot on its own and take you to the Android set up screen.

    If you wish to you can also relock the bootloader with this command:
    Code:
    fastboot flashing lock
    (This command will wipe all user data from the device)
    Important: do not lock the bootloader unless you have first flashed the stock images. Locking the bootloader while you have a custom recovery installed can result in a brick. Please also note that the locking procedure will wipe all user data from the device.
  • Once all commands/flashes are complete you can reboot the device:
    Code:
    fastboot reboot
The Following 6 Users Say Thank You to bajasur For This Useful Post: [ View ] Gift bajasur Ad-Free
27th November 2016, 02:45 AM |#4  
bajasur's Avatar
OP Retired Forum Moderator
Flag San Clemente
Thanks Meter: 10,633
 
Donate to Me
More
Frequently Asked Questions

1. How do I boot into the bootloader?
[indent]Power off your device. Once it's powered off hold power + volume down and the phone will boot into the bootloader. You can also use the following adb command:
Code:
adb reboot bootloader
2. When issuing the fastboot flashing unlock command it doesn't work, I only get a list of possible commands. What's going on?
This is usually due to having an outdated adb/fastboot setup. If you installed adb/fastboot by any means other than via the Android SDK this is probably the cause. Visit the prerequisites section in the beginning of this guide to properly install adb/fastboot and ensure that it's up to date.
3. After unlocking the bootloader I get a message that says "Your device software can't be checked for corruption. Please lock the bootloader". What's going on? Can I get rid of it?
This is nothing to worry about, it's normal to see this when you have an unlocked bootloader. You can't remove it, as long as your bootloader is locked it will stay there.
4. How do I take an OTA or update if I have root or other system modifications on the stock ROM?
You can't take an OTA update while you have root or any system modifications. You'd need to use fastboot to flash the system, boot, and recovery images. It's much easier to just flash the newer build with fastboot.
5. Does taking an OTA update wipe my user data?
No, it doesn't.
6. Do I need to flash the userdata.img from the factory images?
You should never flash the userdata image. It doesn't take into consideration the storage capacity of the device and always allocates 32gb of storage. This is ok for the 32gb model, but for the 64gb and 128gb models you'll end up with much less storage capacity than you should have. If you wish to wipe your internal storage you'd use the following command instead:
Code:
fastboot format userdata

More to come, special thanks to @Heisenberg for his excellent guide format
The Following 9 Users Say Thank You to bajasur For This Useful Post: [ View ] Gift bajasur Ad-Free
27th November 2016, 02:48 AM |#5  
BeansTown106's Avatar
Inactive Recognized Developer
Flag BeanTown USA
Thanks Meter: 54,819
 
Donate to Me
More
Reservation
The Following 9 Users Say Thank You to BeansTown106 For This Useful Post: [ View ] Gift BeansTown106 Ad-Free
27th November 2016, 03:31 AM |#6  
Kris Nelson's Avatar
Senior Member
Flag Beautiful Virginia
Thanks Meter: 5,611
 
More
Don't forget to pin this
The Following 3 Users Say Thank You to Kris Nelson For This Useful Post: [ View ] Gift Kris Nelson Ad-Free
27th November 2016, 04:42 AM |#7  
Senior Member
Thanks Meter: 310
 
More
Dude, awesome
The Following User Says Thank You to ramblinman For This Useful Post: [ View ] Gift ramblinman Ad-Free
27th November 2016, 08:16 AM |#8  
Heisenberg's Avatar
Retired Forum Moderator
Flag Knocking on your door
Thanks Meter: 19,088
 
Donate to Me
More
Looking good @bajasur!
The Following User Says Thank You to Heisenberg For This Useful Post: [ View ] Gift Heisenberg Ad-Free
27th November 2016, 08:45 AM |#9  
Senior Member
Thanks Meter: 41
 
More
Nice! Great job...should definitely be pinned
27th November 2016, 03:36 PM |#10  
Thanks so much @bajasur! I always used the one by the famous @Heisenberg for the 6P and its great to have one for the Pixel XL.

Any plans to also include the step-by-step for restoring back to stock?
27th November 2016, 04:44 PM |#11  
bajasur's Avatar
OP Retired Forum Moderator
Flag San Clemente
Thanks Meter: 10,633
 
Donate to Me
More
Quote:
Originally Posted by MinimalistChris

Thanks so much @bajasur! I always used the one by the famous @Heisenberg for the 6P and its great to have one for the Pixel XL.

Any plans to also include the step-by-step for restoring back to stock?

Yes, there is a lot more to come. For now to restore to stock I recommend running the flash-all.bat file that comes within the factory image folder.

A detailed step by step image flashing guide will be linked in the next few days.

Sent from my Pixel XL using XDA-Developers mobile app
The Following 2 Users Say Thank You to bajasur For This Useful Post: [ View ] Gift bajasur Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes