Install CM 14.1 Android 7.0 Nougat on HTC One M8/M8D & HTC One A9

The HTC devices are some of the most well-built devices out there with brilliant speakers in most of the variants. Although the hardware was top-notch, there was so much more users desired from the software. The Official CM14.1 Nightlies are out for the HTC One M8, M8d (Dual SIM) and the HTC One A9 (hiae).


Unlocking the Bootloader

Note: This will wipe all data on your device. Make sure you backup important files as necessary before proceeding.

  1. Enable Developer Options on the HTC device. This can be done by going to Settings, About Phone and tap the Build number about 5 times. This should enable the Developer Options on the Settings menu
  2. In Developer Options, turn on Enable OEM Unlock and USB Debugging
  3. Go to HTCDev site and choose your respective HTC device on the drop down menu. Also make sure you have logged in/created an account on the site and click “Begin Unlock Bootloader”. This will popup a series of Legal Terms which you’ll have to accept to continue.
  4. Now switch the device off to boot to bootloader. You can boot to the bootloader by pressing down Volume Down + Power. Then, use the Volume buttons to navigate up or down and select BOOTLOADER by pressing the Power button.
  5. Open up Minimal ADB & Fastboot on your PC and connect the device. To confirm whether the device has been connected, type in “fastboot devices”. You should see your device listed. It is advised to disconnect all other Android devices, if any.
  6. Now on the ADB, enter “fastboot oem get_identifier_token” (no quotes). This should generate a long string of text which should be copied to the text box My Device Identifier Token on the HTCDev site. Once this token is submitted, you should receive a mail from HTC on your registered email address with a file named Unlock_code.bin.
  7. Download this file and move it to the Minimal ADB folder. For most people, it is usually C:\Program Files (x86)\Minimal ADB and Fastboot. Now, enter “fastboot flash unlocktoken Unlock_code.bin” on the adb and you should get a prompt on the HTC 10. Read the on-screen instructions and press the Volume Up to accept and Power to confirm.
  8. Your device should now be unlocked.

Flashing TWRP

If you’re not in fastboot mode, follow the above steps and enter fastboot mode. We need to download the TWRP files for our respective devices from the links below:

  • HTC One M8, M8d (Dual SIM) universal variant download.
  • HTC One M9 (hiar) download.

Download the TWRP file, rename it to “twrp.img” (no quotes) and place on the folder where the Minimal ADB is installed. For most people, it is usually C:\Program Files (x86)\Minimal ADB and Fastboot.

Once the file is in the folder, we can go back to Minimal ADB and type in the command:

fastboot flash recovery twrp.img

This will replace the stock recovery with TWRP. Once the flash completes successfully, reboot the device into recovery to verify the installation. With the device powered down, hold the Volume Down and Power buttons until HBOOT appears, then release the buttons. Navigate using the volume keys and select RECOVERY using the Power key. It is important that you boot to recovery before booting to system as most stock ROMs replace the custom recovery.

Flashing CM14.1

Firstly, we need to download the latest CM14.1 Nightly available for our device.

Once downloaded, copy the zip file to the internal storage of the device. In TWRP, select Wipe, then Factory Reset. Then, select Install and choose the CM14.1 zip package. This will prompt you to “Swipe to Flash”. Once the installation has finished you can Reboot to System. Note that the first boot might take a while.

Flashing GApps

GApps (Google Apps) package is required for using Google Services. These services are pre-built out-of-box, but we need to flash the GApps zip in order to Install. It is recommended you flash GApps right after flashing CM14.1. You can follow the tutorial to flash GApps here.