Many Android enthusiasts have installed either the available stock or the AOSP based Android 6.0 Marshmallow ROM on their device. If you are one of them, then this tutorial will help you root this Marshmallow ROM with ease. Thanks to the senior member at XDA, ktetreault14, Nexus 4 has a modified boot image that will help you flash the SuperSU package onto your system.
You can install the AOSP based Marshmallow ROMS on your Nexus 4 from our tutorial; refer to the link at the very end of this page. If you have already installed this or any other custom ROM that supports Android 6.0, then you first need to install the boot image and then flash the Super SU v2.51 provided by Chainfire. SELinux is Enforcing, for your information.
That’s it, once you reboot to system, you will have a rooted ROM and you can now start modifying your system and get into development again. Be sure to backup everything. Let’s begin with the process.
- Download (Mirror)| Modified Boot Image for Nexus 4 (File: Fixed_Data_root.img (6.5 MB))
- Download | SuperSU v2.51 (File: BETA-SuperSU-v2.51.zip)
- Download | SuperSU v2.52 (File: BETA-SuperSU-v2.52.zip)
- This guide is compatible with only Nexus 4 device. Do not try it on any other device.
- You need a Custom Recovery like TWRP installed on your Nexus 4 in order to flash a custom ROM. To Install TWRP, download the latest TWRP from here or here and get to this link for a tutorial.
- You must have device drivers installed on your PC so that you can transfer the ROM and Google apps to your device’s storage.
- You must fully charge your device or at least to 60%, as the process may take a while.
Backup your Apps and Data
Before you proceed, make sure you backup all your data. This process will wipe all the data from your device except for the internal storage. Hence, a full backup or nandroid backup is recommended. Also backup all your internal storage files just in case anything goes wrong. Take a nandroid backup from the custom recovery before flashing the ROM.
Warning: Warranty may be void if you root or install custom ROM on your device. We at DroidViews won’t be liable for any damage to your device whatsoever. We are not responsible if you brick or damage your device. Reader’s discretion is advised.
How to Root Nexus 4 on Android 6.0 Marshmallow ROM
- Download the Boot Image and the SuperSU package from the download section.
- Now transfer the two files into your device’s internal storage. Place the zip file where you can easily locate it.
- Now reboot into TWRP recovery. To boot into TWRP, first turn off your device and then press and hold volume down and power keys at the same time.
- Although this is optional, it’s highly recommended that you perform a nandroid backup. To back up your ROM, tap on backup option in TWRP and select the following elements: System, Data, Boot, Recovery, EFS and swipe right where appropriate, to back up.
- Tap on Install in the TWRP main screen. Now to by default, the mode is to flash zip files, you will need to toggle the mode to images to install the boot.img file.
- To do so, tap on the Images… button on the bottom-right of the screen. The recovery will now only see the image files, select the one listed in this guide.
- Once you select the Boot image, you will be prompted to select the type of image it is; choose Boot.
- Now confirm the swipe action to proceed with the installation.
- Now change the TWRP mode back to zip using the same procedure and now you are ready to flash the SuperSU zip file to root your device.
- Go back to the TWRP main menu or home screen and tap on the install option. Navigate to the SuperSU file and select it.
- Swipe the confirmation button to proceed with the installation.
- Once installed, reboot to system.
When you see the boot logo, that means you have successfully installed the ROM on your device. If you come across any bootloops or face system errors, try a factory reset from the recovery or you can always restore your previous ROM from the backups. For queries, comment down below.
You can also refer to our ADB and fastboot method to flash the boot image or install TWRP if it the above method doesn’t work for you, from this page and refer to flashing boot images in method 2.
See how to