If you flashed the Nexus 4 Marshmallow custom ROM we shared yesterday, then you must be missing root access. Normally, custom ROMs come pre-rooted, but the said ROM was so build using AOSP code, that you had to flash the system.img manually, and thus root wasn’t injected into it already.
Anyway, like the Marshmallow root for Nexus 5 and Nexus 6, you have a modified boot.img here, that you have to flash first, and then flash the new SuperSU 2.50 beta to gain root access.
We’ve detailed the procedure below, and hope it makes it easy enough for you.
Be sure to thank the developer ktetreault14 for this, as he’s the one who did all labor and trickery to gain must-have root access on Nexus 4.
- Modified boot image — Link | File: modified_6_boot.img (6.47 MB)
- Nexus 4 TWRP file — Link | File: twrp-126.96.36.199-mako.img (8.8 MB)
- Download SuperSU 2.51 — Link | File: BETA-SuperSU-v2.51.zip (3.8 MB)
- Nexus 4, model no. D821 and D820
- Don’t try this on any other device whose model no. is not same as given above!
Warranty may be void of your device if you follow the procedures given on this page. You only are responsible for your device. We won’t be liable if any damage occurs to your device and/or its components.
Backup important files stored on your device before proceeding with the steps below, so that in case something goes wrong you’ll have backup of all your important files.
Marshmallow Root Video Tutorial
Here is a video tutorial right below that shows how you can root your nexus device using Chainfire’s root method, and it uses the guide below exactly.
It’s good if you watch the video and proceed with the guide. Especially if you are new to rooting and flashing stuff using fastboot commands and TWRP.
How to Root Marshmallow Update on Nexus devices
Step 1. Download the three files required for Marshmallow root using this method. So, download the modified boot file (in .zip format), then TWRP file, and then the SuperSU file. Keep them in a new folder called root6
Step 2. In root6 folder, rename the TWRP recovery file to twrp.img and boot image file to boot.img — this makes it easy to enter commands when installing the boot and TWRP recovery below in this guide.
So, you now have boot.img and twrp.img in the folder called root6, right?
Step 3. Install ADB and Fastboot drivers on your Windows PC.
Step 4. Connect the device to PC, and transfer the SuperSU file to your Nexus device. Remember the location of the file. Then disconnect the device from PC.
Step 5. Boot your device into bootloader mode. For this,
- Power off the device. Then wait for 4-5 seconds after screen goes off.
- Press and hold Volume down + Power button together to enter bootloader mode. You will see FASTBOOT written at top.
Step 6. Now, open command window in the root6 folder, in which you have the modified boot and TWRP files. For this:
- Open that root6 folder and then left click on empty white space in the folder.
- Now, while holding shift key, right click on empty white space to get a pop-up as shown below.
- Now choose Open command window here option from that.
You will see a command window open up, with location directed to root6 folder.
Step 7. Test whether fastboot is working alright. In the command window by running the following command.
→ Upon this, you should get a serial no. with fastboot written after it. If you don’t get fastboot written on cmd window, then it means you need to reinstall adb and fastboot drivers, or change restart PC, or use original USB cable.
Step 8. Make sure your Nexus device is bootloader unlocked. Skip this step if your device is already unlocked (check the Lock status at bottom of the screen in bootloader mode).
If your device is not bootloader locked, then do this to unlock bootloader of it. This WILL DELETE everything on the device. Device will restart after this,
- Run the following command first.
fastboot oem unlock
- Now, look at device’s screen, and press Volume up button to choose Yes. (Upon doing this, your device’s all apps and data will be deleted.)
→ Because unlocking the bootloader will delete everything on device, you will need to transfer the SuperSU file again (step 4).
Step 9. Flash modified boot image now. Use the following command for that.
fastboot flash boot boot.img
(You have to use the boot image’s filename in the above command, which in our case is boot.img, from step 2.)
Step 10. Flash TWRP recovery image now. Use the following command for that.
fastboot flash recovery twrp.img
(You have to use the recovery image’s filename in the above command, which in our case is twrp.img, from step 2.)
Step 11. When done, simply reboot to Recovery mode now.
For this, disconnect the device. Now, use Volume up/down button to bring up RECOVERY menu, and then use Power button to select it.
You will boot into recovery mode now, and will see TWRP recovery.
Step 12. Now’s the time to root Marshmallow update on your Nexus device. Install SuperSU now.
In TWRP, tap on Install, and then select the SuperSU file. Next, do the swipe action at bottom of the screen to flash the SuperSU file.
Step 13. When done, tap on Reboot System button to restart the device.
That’s it. Your Nexus device on Marshmallow update is now rooted with Chainfire’s root trick.
Need help? Let us know via comment section below.