Just like the Nexus 6P and any other Nexus device, gaining root access on the LG-made Nexus 5X is a relatively easy process. Especially if you have boot loader unlocked, the process hardly takes a few minutes.
But if you don’t have the boot loader unlocked, gaining root access on the Nexus 5X can be quite troublesome since the internal storage of the handset will be wiped out. On the flip side, with root access on your 5X, you will be able to use apps like Root Explorer, Greenify and even install Xposed framework and its modules.
If you have made up your mind on rooting your Nexus 5X, simply follow the steps below.
Step 1: If you have not already, you need to first unlock the bootloader of your Nexus 5X. This can be done by following the steps here. Do not close the command prompt or the terminal window that you open during this process since it will be required in the later steps.
Step 2: Download TWRP recovery image file and SuperSU zip file for the Nexus 5X from below. Make sure to download the absolutely latest version of both otherwise you will run into compatibility issues. Transfer the files to the same “nexus” folder that you had created while unlocking the bootloader of the device. Also, for simplicity’s sake, rename the TWRP image file name to “nexus.img”.
Step 3: If your Nexus 5X is in bootloader/fastboot mode, boot it back into Android. You can go through the initial set up and log in to your Google accounts if you wish to. Once that is done, connect the device to your PC and transfer the SuperSU zip file to its internal storage.
Step 4: Again switch off the handset and boot it into bootloader mode by pressing and holding the Volume down and Power key simultaneously. Once the 5X boots into bootloader mode, connect it to your PC.
Step 5: Verify that the handset is being detected on your PC by running the following command:
Windows:
fastboot devices
Mac:
fastboot devices
Step 6: Now flash the TWRP image by executing the below command:
fastboot flash recovery nexus.img
Step 7: Boot your Nexus 5X into TWRP recovery using the following command:
fastboot boot nexus.img
Step 8: Once TWRP boots up on your Nexus 5X, tap on ‘Install’ and then navigate and select the SuperSU zip file. The installation procedure will take only around a few seconds.
If TWRP prompts you to grant it permission to modify some system settings so that the recovery is not replaced at the next boot, make sure to swipe on yes.
Step 9: Proceed to reboot your device back into recovery by selecting the ‘Reboot system’ option. When prompted by TWRP to install SuperSU, make sure select the ‘Do not Install’ option.
Once your device boots back into Android, you should have the SuperSU app in your app drawer. To confirm whether you have root access on your Nexus 6P or not, you can use applications like Root Checker from Google Play.
Do note that since you have installed a custom recovery on your Nexus 5X, you will not be receiving direct OTA updates from Google. Instead, you will have to manually sideload them.