This tutorial is for those of you with Loki’d unlocked bootloader on the AT&T SGH-i337 or Verizon SCH-i545, DO NOT FOLLOW THIS GUIDE IF YOU HAVE ANDROID 4.3 OR HIGHER ON AT&T OR VERIZON. If you already have CWM or TWRP recovery installed, that means you can follow this guide. If you have Safestrap recovery, that means your phone is on the locked bootloader so DO NOT FOLLOW THIS GUIDE!
If you want to install latest Lollipop AOSP ROMs like CM12 or CM12.1, you will need to upgrade your recovery to latest TWRP recovery, I recommend TWRP v18.104.22.168, which I have tested is very stable and also lets you automatically mount to your computer as MTP or connect your flash drives via USB flash drives.
To install, you will need a rooted AT&T or Verizon Galaxy S4, then download the following TWRP image files onto your phone:
Download TWRP v.22.214.171.124 for AT&T Galaxy S4 SGH-i337 – Link
Download TWRP v.126.96.36.199 for Verizon Galaxy S4 SCH-i545 – Link
Then use Terminal Emulator app and type:
dd if=/sdcard/Download/twrp-188.8.131.52-jflteatt.img of=/dev/block/mmcblk0p21
dd if=/sdcard/Download/twrp-184.108.40.206-jfltevzw.img of=/dev/block/mmcblk0p21
DO NOT USE FLASHIFY, IT WILL BRICK YOUR PHONE as recovery for Loki’d devices are different.
That’s it, try rebooting into recovery and you should have latest TWRP v220.127.116.11, now you can install any Lollipop custom ROMs or even older KitKat ROMs too.
Credits – TWRP
What is a Custom ROM?
A custom ROM is a custom, modified operating system that you can install on your Android device. Basically it's like installing Windows OS on a Macbook. By installing a custom ROM, you can bypass stock factory settings like locked hotspot tether, install new Android versions early, or even convert your phone into another OS.
With a custom ROM, you can really maximize the capabilities of your smartphone by adding custom features that have been developed by open source developers.
How to Install Custom ROMs
First, you will need to root your device, if it is not rooted yet, follow our root tutorial and root your phone.
Once rooted, you should have TWRP installed on your phone. Installation of a custom ROM is easy if you learn the basic of it. If you don't know how to install custom ROMs using TWRP recovery, see our tutorial on How to Install Custom ROM using TWRP!