How to root OnePlus 5 and 5T

OnePlus 5 and 5t twrp root guide

Update [January 03, 2019]: Added Magisk v18.0.

Update [September 02, 2018]: Added TWRP 3.2.3-1 for the OnePlus 5 too. This version supports Project Treble as well as an ability to decrypt the data partition, which is cool.

Update [August 20, 2018]: The article has been updated to provide latest TWRP recovery that supports Android 9 Pie as well as Project Treble, TWRP 3.2.3-1.


Well, some good news here, folks! The OnePlus 5/5T root is now available, meaning you can now gain superuser access on the OP5, and use your favorite root apps for some super cool stuff right away.

The OnePlus 5 root is available thanks to TWRP recovery for the device becoming available today, which is what you need to install first in order to gain root access.

Though, that’s not really the first step, as you would need to unlock the bootloader of your OnePlus 5 first. So, achieving root access on OnePlus 5 goes in this order: unlock the bootloader, then install TWRP, and then dead-simple method to gain root access.

We have covered everything below in our guide to help you root OnePlus 5/5T easily, so do check it out now.


OnePlus 5T root

To be able to root. you need TWRP recovery, and for TWRP, you first need to unlock the bootloader of your OnePlus 5 or OnePlus 5T, whatever you have.

How to Unlock Bootloader on OnePlus 5 and OnePlus 5T

  1. Setup ADB and Fastboot on your PC. For help, use this link .
  2. Enable OEM unlock and USB debugging:
    • Go to your phone’s Settings » About phone » and tap “Build number” Seven/Ten times. This will enable Developer options on your OnePlus 5.
    • Now go to Settings » Developer options » and look for “Enable OEM unlock” option, tick the checkbox next to it.
    • On the same page, also tick the USB debugging checkbox.
  3. Connect your phone to PC and open a command window on the PC.
  4. Reboot your OnePlus 5/5T into Bootloader/Fastboot mode by issuing the following command:
    adb reboot bootloader

    └ Check your phone’s screen, if it asks for “Allow USB debugging”, accept it by selecting OK/Yes.

  5. Once it is booted into Bootloader mode, issue the following command to finally unlock the bootloader on your OnePlus 5/5T:
    fastboot oem unlock

    └ This will unlock the bootloader on your OnePlus 5/5T and also completely wipe your phone while doing that. So make sure you backup everything important on your device before unlocking the bootloader.

  6. Once the bootloader is unlocked, your OnePlus 5/5T will automatically reboot. In case it asks for bootloader unlock permission on the device, accept it.

That’s all. Your OnePlus 5/5T bootloader should be unlocked now and you can install/flash a custom recovery like TWRP on it.


TWRP recovery

Download the TWRP recovery from below:

We are providing a single guide below that helps you install TWRP first, and then root the device. So, to install TWRP, just follow the root guide below.

OnePlus 5 and OnePlus 5T Root

Warning!

Do not try anything given on this page if you do not know completely what you are doing. In case any damage occurs, we won’t be held responsible.

Compatibility

The stuff given on this page is compatible only with the OnePlus 5 and OnePlus 5T. Do not try this on any other device as you might end up damaging your device.


Let’s see how to install TWRP first, and then root the OnePlus 5 and OnePlus 5T.

  1. Make sure you have unlocked the bootloader of your OnePlus 5 and OnePlus 5T (as given above).
  2. Download the required files:
    1. TWRP recovery from above
    2. Magisk 18.0 root package
    3. DM Verity disabler
  3. Make sure you have enabled USB Debugging on your OnePlus 5 device. You may need to re-do it after unlocking the bootloader.
  4. Connect your OnePlus 5 device to PC using the USB cable that came with it.
  5. Now open a command window inside the folder where you have the TWRP file from above. For this, go that folder, and then type cmd in the address bar of that folder’s window, and then hit the enter key. A command window will open up, and its location will be that folder.
    open-a-command-window-in-a-folder
  6. Connect your OnePlus 5 device to the PC. And type the following into the command window we opened in Step 5 above to boot your device into bootloader/fastboot mode:
    adb reboot bootloader

    └ If you get a permission dialogue on your OnePlus 5/5T to “Allow USB debugging”, tap OK.

  7. Once your OnePlus 5/5T boots into bootloader mode, issue the following command into command window to flash the TWRP recovery .img file :
    fastboot flash recovery <name of twrp file here>.img
  8. Run the command below to reboot into recovery mode to make sure the system doesn’t remove the TWRP upon reboot to Android.
    fastboot boot <name of twrp file here>.img
  9. The device will reboot to recovery mode and you will see TWRP recovery right there. Tap on ‘Keep Read Only’ button now to do not allow system modifications.
    twrp keep read only
  10. [Ignore this if using TWRP 3.2.3-1 on OnePlus 5.] In TWRP, tap on Wipe, and then on Format data option. Type yes on the next screen to confirm wiping of data. This will delete everything on the device.
  11. Connect your OnePlus 5 to your PC now using a USB cable and transfer the DM Verity disabler file and Magisk file to the device again as everything on the device is deleted now. (No for OnePlus 5 though if you used TWRP 3.2.3-1 on that device that already supported decryption and thus ‘Format data’ was not required.)
  12. Time to root your OnePlus 5 device. Install the magisk file to root the device, but if you don’t want to root, you still need to install the DM Verity disabler file to prevent the device from bootlooping when starting to Android from TWRP.
    → Go back to the home screen of TWRP and tap on Install button, and then select the Magisk file (or DM verity disabler if you don’t want to root), and confirm the installation on the next screen.
  13. Reboot now and your OnePlus 5 will start to Android. If you installed Magisk, you can verify root access on your OnePlus 5 using a root checker app. (If you want to install Android Pie now using TWRP, see check out the link below.)

How to install Android 9 Pie on your OnePlus 5 and OnePlus 5T now


How to reboot into recovery mode to access TWRP recovery

TWRP recovery should be installed on your device now. To boot into the freshly installed recovery, you can use adb — simply issue the adb reboot recovery command after connecting the device to PC.

Or, use the manual mode to reboot into recovery mode as explained below:

  1. Power off the device.
  2. Press and hold power and volume down buttons together for a few seconds until you see the OnePlus logo on the screen. You will see the TWRP soon.

Happy Androiding!

Posted by
Kapil Malani

A die-hard Liverpool FC fan, Kapil is a big fan of Batman, Android and street Cricket. In that order, probably. Email: [email protected]

11 Comments

  1. Hey,
    at first I want to say thx for the work!
    The first two steps worked fine, but after installing the super su ZIP, I get the massage “installation failed”
    Thanks for helping
    Jan Riedler
    Email: [email protected] (If you know whats wrong) thx

    1. One thing worth noting (and a cause of a lot of hair-pulling on my part)…you may not ever be getting to the twrp recovery. The OnePlus OS will overwrite the custom recovery at the first chance it gets. If you see a OnePlus logo on the recovery screen, you’ve missed it. You need to catch the very first reboot after the flashing TWRP and make sure it goes into recovery (it might go through a few cycles of boot-screen, select->Recovery, boot-screen, etc.)

    2. John, thank you for the advice. That helped. I could not figure out why TWRP was not taking.

  2. Mr highly Skilled

    Hey,
    at first I want to say thx for the work!
    The first two steps worked fine, but after installing the super su ZIP, I get the massage “installation failed”
    Thanks for helping
    Jan Riedler
    Email: [email protected] (If you know whats wrong) thx

    1. One thing worth noting (and a cause of a lot of hair-pulling on my part)…you may not ever be getting to the twrp recovery. The OnePlus OS will overwrite the custom recovery at the first chance it gets. If you see a OnePlus logo on the recovery screen, you’ve missed it. You need to catch the very first reboot after the flashing TWRP and make sure it goes into recovery (it might go through a few cycles of boot-screen, select->Recovery, boot-screen, etc.)

      1. John, thank you for the advice. That helped. I could not figure out why TWRP was not taking.

  3. Will data in the phone be lost with this procedure?

  4. hey, i did everything and it went just fine and now my op5t is stuck in the twrp and cannot reboot to android, please help

  5. Hey,

    When we unlock the bootloader in the device, it also completely wipes the phone. Does that mean the data cannot be recovered after unlocking the bootloader?
    I do not make any changes to the device or OS, just want to recover the deleted data from my device. Any suggestions?

  6. Cristiano Arantes

    Hi, Thanks for the clear instructions – I just want to add that this step is crucial “You need to catch the very first reboot after the flashing TWRP” – for me when I booted into android the recovery got back to stock OP. You really need to go to the recovery boot after flash twrp if you are getting issues.

    1. Will add that for sure.. Thanks!

Comments are closed.