Android Rooting will void phone's warranty. We are not responsible for any damage or data loss caused to your phone. Do it on your own risk.
Make sure your phone is charged 70% at least.
Back up all your phone data.
Follow these steps:
1. Download and install the necessary USB drivers for your Nexus 4.
2. Enabled the USB debugging mode on the device by going into Settings > About phone > Build number > Tap it 7 times > Go back > Developer options.
3. Download Android SDK and download fastbootand extract it in android-sdk-windows\platform-tools directory. Create directory if not already there.
4. Now enter into the Bootloader / Fastboot Mode on Nexus 4 by pressing Volume Down + Power keys for a few seconds till you see some text and the START on the screen. This is the Bootloader Mode which allows Fastboot to communicate with your phone.
5. Navigate to android-sdk-windows\platform-tools directory and open Command Prompt by pressing Shift + Right-click > Open Command Prompt. In Command Prompt type "fastboot oem unlock" and follow the on screen instructions. Your phone will unlock the bootloader and reboot itself doing a complete factory data restore.
6. Download SuperSU.zip and ClockworkMod recovery. Transfer the SuperSU file to the internal storage of your phone and copy and paste the clockworkmod recovery file to "android-sdk-windowsplatform-tools" directory that you have created during the preparation of Android SDK and fast boot toolkits.
7. Bring your Nexus device to fast boot or boot loader mode by pressing and holding the "volume down + power keys" for a few seconds till you see text on the screen and connect it to the computer.
8. On your computer open Command prompt Window on the "android-sdk-windowsplatform-tools" directory (shift > right-click > open Command Prompt) and type in the following command "fastboot flash recovery recovery-clockwork-touch-188.8.131.52-mako.img".
9. Once completed go back to your phone and select recovery in the fastboot menu.(Use volume keys to scroll and power button to select.)
10. Once you are in recovery in
stall the SuperSU rooting kit by selecting "flash zip from SD card > choose zip from SD card > find the SuperSU update zip > confirm installation.
11. After the installation, go back to the main menu then select "reboot system now."
If the Super SU app appears in app drawer that means your phone is rooted!