…
Rooting your HTC One M8 gives you access to deep installation into your system and easier adjustment of your device.
Before doing so, you should know that rooting a device may cause damage, or the device will no longer be under warranty, so using this method is up to you to decide. Be prepared for a device with more than 30% battery.
To come to this tutorial your device has been Unlocked Bootloader, you can see the instructions here
One on note before rooting :
– Backup Stock Rom so that when you want to go back to the original, you can Restore it:
How to do it :Go to Bootloader => Select Recovery => Select Backup => Wait for completion (Stock Rom after Backup will be saved in HTC One M8 ).
– If you decide to use rom cook always, you can skip this root step to flash rom cook always. Because the cook roms have built-in root. When you finish flashing the rom, you will have SuperSU always. And if you only need to root and still use stock rom to install Titanium Backup or some software that requires root access, you need to do this root step)
Step 1 . Download the following tools
– ADB M8
– HTC driver
– File Root SuperSU
Step 2 . You need to copy the SuperSU Root File file that we downloaded above to your computer.
Step 3 . Then you bring the device to Recovery mode, you select Install => select where you save the File Root SuperSU => Select File Root SuperSU =>Drag the consent bar and wait for it to finish loading will say Complete.
Step 4 . You select Reboot now to let the machine restart again is Ok.
https://Software/root-htc-one-m8-842n.aspx
So we have guided you to Root HTC One M8, this is one of the ways to Root Android device, you can apply this way to root.