How to Root the LG Nexus 5X: Step-by-Step
Rooting your LG Nexus 5X gives you full administrative control over the Android operating system, allowing you to remove bloatware, install custom kernels, use root-only apps, and flash custom ROMs. This guide walks you through unlocking the bootloader, installing a custom recovery, and flashing Magisk to root your device. Before starting, back up all data — unlocking the bootloader wipes your phone completely.
What You’ll Need
- A Windows, macOS, or Linux computer
- A USB cable compatible with the Nexus 5X (USB-C to USB-A or USB-C to USB-C)
- The Nexus 5X itself, with at least 70% battery
- Android SDK Platform Tools (ADB and Fastboot) installed on your computer
- The Magisk ZIP file (latest stable version) downloaded to your computer
- A custom recovery image, such as TWRP (Team Win Recovery Project), for the Nexus 5X (bullhead)
- Optional: a microSD card or USB OTG drive if you want to store the Magisk ZIP externally (the Nexus 5X has no SD card slot, so you’ll transfer the ZIP via ADB or MTP)
Step-by-Step
- Enable Developer Options and USB Debugging
On your Nexus 5X, go to Settings > About phone and tap Build number seven times. You’ll see a message that Developer Options are enabled. Then go to Settings > Developer options and turn on USB debugging and OEM unlocking (if present). - Install ADB and Fastboot on your computer
Download the Android SDK Platform Tools from the official Android developer site. Extract the ZIP to a folder you can easily access (e.g., C:\platform-tools on Windows, or ~/platform-tools on Mac/Linux). Open a command prompt or terminal in that folder. - Connect your phone and verify ADB
Connect the Nexus 5X to your computer via USB. In the command prompt, typeadb devices. If you see a device listed with “unauthorized,” check your phone and accept the RSA fingerprint prompt. Once authorized, you’ll see “device” next to the serial number. - Unlock the bootloader
Typeadb reboot bootloader. The phone will reboot into fastboot mode. Then typefastboot flashing unlock(orfastboot oem unlockon older builds). On the phone, use volume keys to highlight Unlock the bootloader and press power to confirm. This wipes all data — that’s expected. - Reboot and re-enable USB debugging
After unlocking, the phone will reboot automatically. Set it up as new, then re-enable Developer Options and USB debugging as in step 1 (OEM unlocking may already be on). - Flash TWRP recovery
Download the TWRP image for bullhead (e.g.,twrp-3.x.x-x-bullhead.img). Place it in the platform-tools folder. Reboot to bootloader again (adb reboot bootloader). Then typefastboot flash recovery twrp-3.x.x-x-bullhead.img. After it finishes, use the volume keys to select Recovery mode and press power. TWRP should load. - Transfer the Magisk ZIP
While in TWRP, go to Advanced > ADB Sideload. On your computer, typeadb sideload Magisk-vX.X.zip(replace with the actual filename). The file will be pushed to your phone. Alternatively, you can boot back into Android and copy the ZIP to internal storage, then reboot to TWRP. - Install Magisk
In TWRP, tap Install, navigate to the Magisk ZIP, and swipe to confirm the flash. Wait for the process to complete. - Reboot and verify root
Tap Reboot system. Once Android boots, install the Magisk Manager app (now called just “Magisk”) from the Play Store or via the ZIP’s included APK. Open the app — it should show the Magisk version and a green checkmark indicating root is active. You can also use a root checker app to confirm.
Common Mistakes
- Skipping the data backup — Unlocking the bootloader erases everything. If you skip the backup, you lose photos, messages, and app data permanently.
- Using the wrong TWRP image — The Nexus 5X is known as “bullhead.” Downloading TWRP for another device (like the Nexus 5 or 6P) will fail or brick your phone.
- Not enabling OEM unlocking — On some Android versions, the OEM unlocking toggle must be on before the bootloader unlock command works. If it’s greyed out, you may need to be connected to the internet and signed into a Google account.
- Flashing Magisk before TWRP is fully installed — If TWRP doesn’t stick (e.g., stock recovery overwrites it), you’ll need to reflash TWRP before installing Magisk.
- Using an outdated Magisk version — Older Magisk versions may not be compatible with the latest Android security patches. Always download the newest stable release.
Tips
- Keep the platform-tools folder path simple (e.g.,
C:\adb) to avoid command-line errors. - After rooting, install a root management app like Magisk Manager to control which apps get root access.
- If you plan to install custom ROMs later, TWRP also lets you create full system backups (Nandroid) — do one right after rooting.
- Disable automatic system updates after rooting, as an OTA can unroot or break Magisk.
- Use a high-quality USB cable to avoid connection drops during flashing.
Troubleshooting
- Fastboot doesn’t recognize the device — Install the proper USB drivers (on Windows, use the Google USB driver via SDK Manager). Try a different USB port or cable. Ensure the phone is in fastboot mode (you see the Android robot with “Start” on screen).
- Bootloader unlock command fails with “FAILED (remote: unknown command)” — Try
fastboot flashing unlockinstead offastboot oem unlock. If that fails, update your platform-tools to the latest version. - TWRP doesn’t stick after reboot — Some stock ROMs overwrite recovery on first boot. After flashing TWRP, immediately boot into recovery (don’t let Android boot first). If it still gets overwritten, you may need to flash a custom kernel or use the “fastboot boot” command to temporarily boot TWRP.
- Magisk installation fails or boot loops — Reboot to TWRP, wipe cache/dalvik, and try again. If still failing, download the latest Magisk ZIP and reflash. If the phone boot loops, reboot to TWRP and restore your Nandroid backup (if you made one).
- Root checker says no root — Open Magisk Manager and check the status. If it says “Magisk not installed,” reflash the ZIP. If it says “Requires additional setup,” follow the in-app prompts.
- Phone stuck on Google logo — This usually indicates a corrupt boot image. Reboot to TWRP and reflash the Magisk ZIP, or restore a backup. As a last resort, flash the stock factory image via fastboot (this will unroot).
Frequently Asked Questions
Will rooting void my warranty?
Yes, unlocking the bootloader and rooting typically voids the manufacturer warranty. However, you can often restore the phone to stock by flashing the factory image, which may restore warranty coverage depending on the retailer and region.
Can I still receive OTA updates after rooting?
Generally, no. OTA updates will fail or cause issues because the system partition has been modified. You can manually flash updates or use custom ROMs that support OTA.
Is it safe to root my Nexus 5X?
If you follow the steps carefully, rooting is relatively safe. The main risks are data loss (mitigated by backup) and the possibility of boot loops if you flash incompatible files. Always use files specifically for bullhead.
Will rooting affect my Google Pay or banking apps?
Yes, many banking and payment apps detect root and refuse to run. Magisk includes a feature called MagiskHide (or DenyList in newer versions) that can hide root from specific apps, but it’s not guaranteed to work with all apps.
Can I unroot later?
Yes, you can unroot by flashing the stock boot image or the full factory image via fastboot. This will remove Magisk and restore the original system, but your bootloader will remain unlocked unless you relock it (which requires another wipe).
What is the difference between rooting and unlocking the bootloader?
Unlocking the bootloader allows you to flash custom images and is a prerequisite for rooting. Rooting gives you superuser access within Android. You can unlock the bootloader without rooting, but you cannot root without unlocking the bootloader (on most devices).
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.