How to root the Samsung Galaxy S4 I9505 How can I root the Samsung Galaxy S4? Phone model: GT-I9505
Method 1: 
Root Galaxy S4 and Install Recovery:


  Note: THIS WILL VOID YOUR WARRANTY AND MAY BRICK YOUR PHONE. THE GUIDE BELOW REQUIRES WINDOWS. (FOR ADVANCED USERS: Extract the .tar and flash the img files with "Heimdall".



Download the PhilZ recovery for your device.
Download the latest SuperSU package and copy it to your phone.
Download the Odin tool and unzip it.
Download and install the Samsung USB drivers on your Windows PC.
Enable USB Debugging on your Galaxy S4.
Now turn off your phone and boot it into the 7. Download Mode by holding the Volume Down + Home + Power buttons together for 2-3 seconds. When you are prompted to press the Volume Up key, do it.
Now connect your Galaxy S4 to computer via USB cable.
Open Odin folder and launch the program as administrator.


  Note: Make sure the message box in Odin shows “Added!” text. If it doesn’t, reinstall the drivers, reboot the PC and the phone and connect it again.

Uncheck the Auto Reboot option on Odin (do not touch any other option).
Click the AP button on Odin and add the PhilZ recovery file with .tar extension.
Now click the Start button on Odin and wait till the installation is finished.
When you get PASS!/RESET! message on Odin, disconnect the USB cable.
Now long press the power button to turn off the device, or remove the back panel and pull out the battery for 20 seconds. Reinsert the battery and then hold the Volume Up + Home + Power keys simultaneously. When the screen turn up and you see the Samsung Logo, release the Power key. Keep the other two keys pressed until your phone boots into the recovery mode.
In PhilZ recovery menu, select Install zip option, navigate to the SuperSU update package (.zip file) and install it.
When you are done with installation, return to PhilZ main menu and select Reboot system now option.