[OnePlus X General] the Doctor:
Notice: Rooting your device will break OTAs because they require an unmodified system, so you might want to check for updates before rooting your X. However, there is a workaround:

Boot into TWRP via step 5E below, but DO NOT flash it (step 5D)!!

Do a backup of your completely stock, unrooted ROM

Root the device by flashing SuperSU...zip

When an OTA hits, you can get it by doing this:

Boot into TWRP again without flashing it (same as step 1 above)

Restore your stock, unrooted ROM (from step 2 above)

Apply the update from stock recovery

Backup the unmodified ROM with the update if you want, then re-root as above.

Note: You will lose any changes, mods or app data since you did the backup, but hey, at least the OTA is applied.

If you get stuck with an update that won't flash and you haven't backed-up your unrooted ROM as above, look here:

[Guide] How to Install OTA's with TWRP, and please hit thanks for [MENTION=5891919]SpiritBreak3r[/MENTION] :good:

_____________________​

Disclaimer:

Rooting does not void the OnePlus X’s warranty

, though damaging your hardware (i.e., burning up your CPU by overclocking, hardbricking the device) will. You proceed at your own risk! I accept no responsibility for what you do with your phone. Follow the directions closely, and the odds are you will succeed without any trouble. If you are not sure what you are doing, do some more research before you try. If you get confused with terminology, try looking here for answers or Google it. If you get stuck, post a question in the thread—we're here to help you.

Preliminary steps​

1. Make sure that your phone is always charged above 50%!!!

Running out of battery in the middle of flashing something could brick your phone.

2. Make sure that your computer can properly communicate with the device:

We will be issuing commands to the phone from your PC via the USB cable using Android’s SDK tools, in particular ADB and fastboot. If you have not done so already, you must install the following on your Windows computer for this to work:

Java runtime

The Universal Android ADB Driver for Windows.

SDK tools for Android (alternately just ADB & fastboot). Remember where this is installed on your harddrive for later!

You can verify the connection between your PC and phone by running the following procedure:

A. With the phone booted normally, connect it to your computer with the USB cable.

B. Enable Android debugging by going to Settings > About phone and tapping on “Build number” 7 times.

C. Go to Settings > Developer options and check “Android debugging”. A dialogue box will appear asking you to authorize your computer’s RSA fingerprint. Click “Always allow...”

D. Open a command prompt in Windows and navigate to the folder where you put SDK tools for Android (ADB & fastboot) above.

E. Type the following command:

adb devices

You should get a return like this:

If you cannot get the connection to work:

1. Check your USB connection, then verify that Android debugging is enabled in settings and that your computer’s RSA fingerprint has been authorized.

2. Still not working? Open Device Manager in Windows and make sure that you don’t have a yellow exclamation point next to something like “Android Device” or “One.” This would indicate a driver problem that must be resolved. Try re-installing the Universal Android ADB Driver for Windows, and make sure to restart your computer. Once you’ve rebooted, if you still have a yellow triangle, right-click on the device and select “Update Driver Software,” then “Search automatically for updated driver software.”

3. If you still have a yellow exclamation point, then try forcing the driver to install:

In Device Manager, right-click on the device and select “Update Driver Software.”

Select “Browse my computer for driver software”

Select “Let me pick from a list of device drivers on my computer”

Select “ADB Interface” from the list

Select manufacturer “Google”

Select “Android Testing Interface Version xxx”

Click “Next.” If you get a warning, select “Yes” to continue and wait for the driver to install properly.

3. Know how to enter “fastboot mode” on the OnePlus X

To root the device, you must be competent at booting it into fastboot mode. There are two ways to accomplish this:

Power off the phone. Then simultaneously hold down the volume up & power buttons until it vibrates. When done correctly, you will see the words “Fastboot Mode” on a black screen. If not, you dumb-thumbed it, and the device will boot normally into Android. Power off the device and try again.

With the phone running Android normally and Android debugging enabled (see above), open a command prompt in Windows, navigate to the folder where you installed SDK tools (ADB & fastboot) and type:

adb reboot bootloader

Rooting the OnePlus X​

There are three essential steps to rooting the device:

Unlock the bootloader

Flash or boot into TWRP custom recovery [For OxygenOS 3.1.3 use TWRP blu_sp★rk r175]

Flash SuperSU...zip from recovery [For OxygenOS 3.1.3 use SuperSU v2.78 SR1 beta]

However, we're going to add a few more to protect your data and device in case something gets borked.

1. Backup your phone’s data

Unlocking the bootloader will involve doing a factory reset resulting in the loss of all accounts, emails, texts, apps and app data, pictures, music, etc. on the device. Move anything you need to keep onto your PC or a cloud service like DropBox.

2. Unlock the bootloader

2A.Go into Developer Options and enable bootloader unlocking

2B. Boot the device into fastboot mode. (Simultaneously hold down the volume up & power buttons until it vibrates.) You should see a black screen with the words “Fastboot Mode”.

2C. Plug in the USB cable.

2D. Verify that your device is connected with this command:

fastboot devices

You should get a return like the image above under Preliminary Steps

2E. Unlock the bootloader using the following commands:

fastboot oem unlock

The device will unlock the bootloader, erase all user data and reboot itself into Android. You will have to set up everything from scratch.

3. Re-enable Android debugging

3A. Re-enable Developer options by going to Settings > About phone and tapping on “Build number” 7 times.

3B. Go to Settings > Developer options. Check “Android debugging” and re-authorize your computer’s RSA fingerprint.

4. Download SuperSU zip

4A. Head over to Chainfire’s CF-Root thread and download the SuperSU access management tool from the “CWM / TWRP / MobileODIN installable ZIP” link. It will probably called something like UPDATE-SuperSU-v2.XX.zip. This zip file will root your device and install the SuperSU access management app in one smooth motion. Hit the thanks button for Chainfire or donate to his Paypal account and buy him a Coke. ;)

NOTE: For OxygenOS 3.1.3 use SuperSU v2.78 SR1 beta

4B. Copy UPDATE-SuperSU-v2.XX.zip to your phone’s SD card.

5. Flash TWRP custom recovery

5A. Download TWRP recovery.

NOTE: For OxygenOS 3.1.3 use TWRP blu_sp★rk r175

5B. Place file you downloaded above to the location where you installed SDK tools (ADB & fastboot).

5C. Boot the device into fastboot mode and connect it to your computer with the USB cable.

5D. In this step, we will replace your stock recovery with TWRP recovery.

Note: This step is optional. If you want to root but preserve stock recovery, skip straight ahead to step 5E below. Thanks [MENTION=5253054]rockuppl[/MENTION] for the reminder. :good:

Open a command prompt in Windows and navigate to the folder where you installed SDK tools (ADB & fastboot). Type the following commands:

fastboot flash recovery twrp-3.0.0-0-onyx.img

5E. Reboot into TWRP recovery with the following command.

fastboot boot twrp-3.0.0-0-onyx.img

You should now see the custom recovery you just flashed, not the stock recovery.

6. Backup your stock ROM before making any changes

In TWRP press “Backup.” <--- See how simple this is??? ;)

Don’t be a noob—backup your device!!! Right now we don't have stock boot debuggable image files for the OnePlus X, so borking your device could leave you with a nice paperweight until we do. :crying: Restoring from a backup in recovery is easy, and only works if you've backed-up first ;)

7. Root the device

7A. The device should still be in recovery from step 6 above. Go back to the main menu and press “Install,” find UPDATE-SuperSU-v2.XX.zip on the SD card, then flash it.

7B. Reboot the phone. It is now rooted!

7C. Go to the app drawer and open SuperSU. Update the binary if prompted. Its icon looks like this:

7D. Download and install Root Checker from the Play Store to verify that you have root access.