CyanogenMod (the famous crowd-sourced custom ROM developer community) has released the stable CM12.1 OS for the HTC One (M8), which is based on the Android 5.1.1 Lollipop OS. However, this software comes with bug fixes, IMAP idle support, SDK v1 release and the Stagefright security software patch. However, to install CM12.1 OS on your HTC One (M8) smartphone, you must root it.
Remember that this software was created especially for the HTC One M8 models, so don’t try to install CyanogenMod CM12.1 Android 5.1.1 Lollipop custom ROM on another Android device. Before installing the custom ROM, you will need to clear memory and back up all your data (we recommend apps such as Clockwork Mod (CWM) Recovery or TWRP).
You will also need to install USB drivers on your PC, otherwise your HTC One M8 will not be recognized. Moreover, the battery of your smartphone must have at least 80 percent juice left, because during the installation process, if the battery dies, your device will be bricked, temporarily or permanently.
The first thing you’ll do is to download the new CM12.1 custom ROM and Google Apps to your computer and use a USB cable to connect your HTC One M8 to it. Next, copy the same Android 5.1.1 Lollipop custom ROM zip file and Google Apps file to your phone’s SD card memory, then in the android-sdk-windowsplatform-tools directory you will place the boot.img file.
After turning off the phone and disconnecting it from the computer, turn it on and enter the Bootloader mode by pressing the Volume down and Power buttons simultaneously. On your computer, you will go to android-sdk-windowsplatform-tools and open command Prompt, where you will type in “fastboot flash boot boot.img”, then click Enter.
Next, you will type in “fastboot reboot” and you will see some instructions on the screen. You will enter Recovery Mode, by selecting the BOOTLOADER option, and then you will need to clear the memory of your phone (wipe data/factory reset). You will use the Volume keys for navigation and the power button to select an option. To clear the cache memory, you will select “wipe cache partition”.
Now, head to the ClockworkMod recovery > Advanced > wipe dalvik cache, then return to the main recovery screen and select “install zip from SD card”. The next step is to tap “choose zip from sdcard” and install Android 5.1.1 Lollipop ROM ty tapping the .zip file from the SD card. Do the same thing with Google Apps and after the installation process completes, head to “+++++Go Back+++++” and restart your phone (tap the “reboot system now” option from the recovery menu).
After a few minutes, when the phone will complete the booting process, you will need to confirm the installation of CM12.1 Android 5.1.1 Lollipop custom ROM by going to Settings >> About phone.