FORUMS
Remove All Ads from XDA

[GUIDE] Unlock/Root/Flash for Moto X Style/Pure

27,318 posts
Thanks Meter: 19,090
 
By Heisenberg, Retired Forum Moderator on 14th September 2015, 11:04 AM
Post Reply Email Thread
Heisenberg's How-To Guide For Beginners

Moto X Pure

Intro

This thread will serve as a location for basic how-to guides for the Moto X Pure. I'm going to start off with a couple of the more obvious ones and go from there. If anyone has any suggestions for additions please feel free to let me know.

Prerequisites:

You'll need a working adb/fastboot environment on your PC to get through some of these guides. 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:\SDK\android-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

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'll find Motorla drivers here, download it and install, then reboot your PC.

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 fastboot mode (power + volume down) and issuing this command:
Code:
fastboot devices
It should return your device serial number, if so, fastboot is working.

By attempting any of the processes listed this thread you accept full responsibility for your actions. I will not be held responsible if your device stops working, catches on fire, or turns into a hipster and claims to have been modified before it was cool.


Index
  1. How To Unlock Your Bootloader
  2. How To Install A Custom Recovery On Your Device
  3. How To Make A Nandroid Backup With TWRP Recovery
  4. How To Root Your Stock Rom
  5. How To Install A ROM with TWRP Recovery
  6. How To Install A Custom Kernel With TWRP Recovery
  7. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System


1. How To Unlock Your Bootloader
  • Go into About Phone in Settings, click on Build Number 7 or 8 times until it says you have enabled Developer Options. Go back to Settings and enter the newly opened Developer Options section, scroll and click on the Enable OEM Unlock option.
  • Power off your phone then boot into fastboot mode (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 this command:

    Code:
    fastboot oem get_unlock_data
    It should return something like this:

    Code:
    (bootloader) 0A40040192024205#4C4D3556313230
    (bootloader) 30373731363031303332323239#BD00
    (bootloader) 8A672BA4746C2CE02328A2AC0C39F95
    (bootloader) 1A3E5#1F53280002000000000000000
    (bootloader) 0000000
  • Copy that code (with no spaces between the characters) and paste it somewhere for safekeeping, you'll use it in a minute.
  • Go to the Motorola bootloader unlocking page. You'll need to create an account with Motorola if you don't already have one. Once you're signed in you can scroll down to step 6 and paste the above code into the text field and hit the “can my device be unlocked” button.
  • Read the terms and conditions and accept them if you agree (you can't continue unless you accept).
  • Click the “request unlock key” button and an email with your unlock token will be sent to the email account that you signed up with.
  • Once you have retrieved the token from the email you can use it within the following command to unlock your bootloader:

    Code:
    fastboot oem unlock xxxxxxxxxx
    (Replace the xxxxxxxx with your unique unlock token)
  • Your bootloader is now unlocked!
  • Reboot with this command:

    Code:
    fastboot reboot
  • It's now safe to disconnect your usb cable.

Please note: this will erase all user data from your device, it is best to do this before you really start using the device and installing apps or putting data on the internal storage


2. How To Install A Custom Recovery On Your Device

Prerequisites: unlocked bootloader.
  • Download the recovery of your choice, here's TWRP.
  • Make sure you check the md5 to verify its integrity (where possible).
  • Place the file in your fastboot folder (this is where fastboot.exe is located on your PC).
  • Put the phone in fastboot mode and connect it to your PC via usb cable.
  • Open a command prompt from within your fastboot folder (shift + right click, select open command prompt here), and enter the following commands:

    Code:
    fastboot flash recovery <filename>.img
    (Replace <filename> with the actual filename of the recovery, the recovery filename in the command will change depending on which recovery you're flashing)
  • Wait for the recovery to flash, it'll only take a few seconds, you'll get a finished message in your command prompt window once it's done.
  • It's now safe to disconnect your usb cable.
  • Don't reboot the phone normally, use the volume buttons to highlight recovery and press the power button to select it. This will stop the stock OS from patching it with the stock recovery in boot. Once you've booted into TWRP like this once, you can reboot normally.


3. How To Make A Nandroid Backup With TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

A nandroid backup is a very important thing to have before installing any custom software on your device. It's basically a backup of your stock system that you can fall back on if anything goes wrong or if you just want your stock ROM back. You can also use the backup tool to create a backup of your favourite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.

All you need to do is enter TWRP recovery, select the backup option from the TWRP home screen, check the system/data/boot boxes, and swipe to backup. The process will take a few minutes.


4. How To Root Your Stock Rom

Prerequisites: unlocked bootloader, TWRP recovery.

Please note: this method is only valid for Lollipop, do not use this method on Marshmallow. You can find a systemless root method for Marshmallow here, big thanks to @ivcarlos!
  • Download SuperSU to your phone.
  • Boot into TWRP recovery.
  • Select the install option from the TWRP home screen.
  • Navigate to where you have SuperSU stored on your sd card and select it.
  • Swipe to install.
  • Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.


5. How To Install A ROM with TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

Installing a ROM is a pretty straight forward and easy process. Before you install anything you should make a nandroid backup (instructions above).
  • Download a ROM and appropriate Gapps package and place on your device.
  • Boot into your custom recovery.
  • Perform a full wipe.
    • Select the wipe option from the TWRP home screen.
    • Select advanced wipe.
    • Check the system, data, cache, and dalvik cache options.
    • Swipe to wipe.
  • Install the ROM.
    • Select the install option from the TWRP home screen.
    • Navigate to where you have the ROM zip stored on your sd card and select it.
    • Swipe to install.
      Most ROMs will run an installer script at this point but some ROMs have what is called an Aroma Installer which allow you to choose some install options before the script runs.
    • You will also need to install the appropriate gapps package directly after installing the ROM.
  • Once you've installed all necessary zips you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.


6. How To Install A Custom Kernel With TWRP Recovery

Prerequisites: unlocked bootloader, TWRP recovery.

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. Wipe the cache/dalvik, hit the back button, and 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 Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System

Prerequisites: unlocked bootloader, TWRP recovery.

There may come a time when you accidentally wipe your OS while trying to perform a basic cache wipe in recovery. Don't laugh, it can happen to the best of us. The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.
This solution seems like common sense but apparently there are quite a few people out there who don't store a ROM or backup on their phone. You might think it's easy to just mount the OTG storage and copy a ROM across to your phone from your PC (which is definitely an option), but there's always a chance that you won't be near your HDD or sd card at the time, or it won't recognise your phone properly. Basically you need to insure yourself against Murphy's law.



Donate To Me
The Following 132 Users Say Thank You to Heisenberg For This Useful Post: [ View ] Gift Heisenberg Ad-Free
 
 
14th September 2015, 03:14 PM |#2  
Tfast500's Avatar
Senior Member
Thanks Meter: 92
 
More
This will be very helpful to many thanks for taking the time to put this together!

Sent from my XT1575 using Tapatalk
The Following User Says Thank You to Tfast500 For This Useful Post: [ View ] Gift Tfast500 Ad-Free
14th September 2015, 04:22 PM |#3  
Senior Member
Thanks Meter: 61
 
More
Thank you so much for taking the time on the guide. There will be many who will use it in the years to come! I'm just about at the verge of needing to root so I can get some insight into my battery life woes
14th September 2015, 06:13 PM |#4  
Oaklands's Avatar
Senior Member
Thanks Meter: 92
 
More
This is much appreciated. All I did on my LG G2 was root as I did not see any roms that interested me since the bootloader is locked. I haven't used TWRP in a couple of years, so all this will help me clear the old cobwebs in my head.
14th September 2015, 07:23 PM |#5  
Junior Member
Thanks Meter: 4
 
More
Thank you so much for this! Exactly the kind of information I need. Can I trouble you to maybe add one more section to your guide: What to do when there's an OTA update from the manufacturer (Motorola)? I have concerns like:

- Would being rooted prevent OTA updates? (Assuming stock ROM).
- Would I need to "unroot" the phone to get the update? If so, how to unroot the the phone?
- Is the process to root the phone again after the the update the same, or could it possibly change?
- Would I need to wait until root is confirmed for the new version before attempting to re-root?
14th September 2015, 07:23 PM |#6  
elitemeat's Avatar
Member
Thanks Meter: 4
 
More
You said to "Make sure you check the md5 to verify its integrity".

What does this mean and how would I do this?
14th September 2015, 08:02 PM |#7  
Senior Member
Thanks Meter: 61
 
More
Thanks again for the guide. I went through this for my own unlock and root, so added a couple of minor things that will help noobs (and me!)

1. Add info on opening developer options, enabling ADB devices, and enable OEM unlock (in options screen)
2. Move this part to the start of the OEM unlock section : )
Please note: this will erase all user data from your device, it is best to do this before you really start using the device and installing apps or putting data on the internal storage
3. Add instructions to copy SuperSU zip file to internal storage and then flash in recovery
14th September 2015, 08:05 PM |#8  
Oaklands's Avatar
Senior Member
Thanks Meter: 92
 
More
Quote:
Originally Posted by elitemeat

You said to "Make sure you check the md5 to verify its integrity".

What does this mean and how would I do this?

You can download an MD5 checker. They give you the MD5 checksum and you can compare when you run the utility. Just do a google search for md5 checker.
The Following User Says Thank You to Oaklands For This Useful Post: [ View ] Gift Oaklands Ad-Free
14th September 2015, 09:53 PM |#9  
Heisenberg's Avatar
OP Retired Forum Moderator
Flag Knocking on your door
Thanks Meter: 19,090
 
Donate to Me
More
Oops
14th September 2015, 10:28 PM |#10  
Heisenberg's Avatar
OP Retired Forum Moderator
Flag Knocking on your door
Thanks Meter: 19,090
 
Donate to Me
More
Quote:
Originally Posted by emailrob

Thanks again for the guide. I went through this for my own unlock and root, so added a couple of minor things that will help noobs (and me!)

1. Add info on opening developer options, enabling ADB devices, and enable OEM unlock (in options screen)
2. Move this part to the start of the OEM unlock section : )
Please note: this will erase all user data from your device, it is best to do this before you really start using the device and installing apps or putting data on the internal storage
3. Add instructions to copy SuperSU zip file to internal storage and then flash in recovery

Thanks for your suggestions.

1. This info has been added.
2. This section is in the same place in all of my guides, I see no problem (and have had no problems) with its location. Anyone following a guide should read it first before attempting it anyway.
3. I've added inductions to download the zip directly to the phone, less mess.
The Following 3 Users Say Thank You to Heisenberg For This Useful Post: [ View ] Gift Heisenberg Ad-Free
14th September 2015, 10:31 PM |#11  
Heisenberg's Avatar
OP Retired Forum Moderator
Flag Knocking on your door
Thanks Meter: 19,090
 
Donate to Me
More
Quote:
Originally Posted by emailrob

Thanks again for the guide. I went through this for my own unlock and root, so added a couple of minor things that will help noobs (and me!)

1. Add info on opening developer options, enabling ADB devices, and enable OEM unlock (in options screen)
2. Move this part to the start of the OEM unlock section : )
Please note: this will erase all user data from your device, it is best to do this before you really start using the device and installing apps or putting data on the internal storage
3. Add instructions to copy SuperSU zip file to internal storage and then flash in recovery

This is already covered here:

http://forum.xda-developers.com/moto...dates-t3200588
Post Reply Subscribe to Thread

Tags
flash, root, unlock

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

Advanced Search
Display Modes