Sometime ago I had rooted my Galaxy S4 (SGH-i337) to enabled WiFi Tethering because I wasn’t done testing the stock image from Samsung / AT&T. Now its time for me to prepare to install CyanogenMod; Before I can do so I need to install ClockworkMod Recovery (CWM) which is a replacement recovery option for Android devices, made by Koushik “Koush” Dutta. More info here.

While the boot-loader on AT&T’s Galaxy S4 is locked  there is a way to install the custom recover using the LOKI method created by one of the XDA Developers which bypasses the boot-loader check to enable the custom recover options and allow you to install ROM’s.

So a few things we need to start and I’ll provide steps that worked for me.

Phone must have been rooted before starting this process (as you will need to move files around in system directories that you can only access as root

You need to download the loki_flash form:  or from Github:

You will need to download the recover.lok for Galaxy S4 from:

Once downloaded use any file explorer that is able to be run as superuser – Example: Root Explorer (File Manager) and locate the two files you have just downloaded.

Select and copy the files loki_flash and recovery.lok to the following directory: /data/local/tmp

If not already installed download the Android Terminal Emulator and once at the command line type “su” without the quotes to elevate to superuser.

Once elevated in the terminal change directory by typing: cd /data/local/tmp | verify you are in the right location by typing “ls” without the quotes and you should see the files recovery.lok and loki_flash

In this directory (/data/local/tmp) type chmod 775 *

Now you will need to run the loki script by typing he following: ./loki_flash recovery recovery.lok | once this is run you will receive a successful message, you can then (when ready) type: reboot recovery in the Android Terminal.

Yeah, I made mistakes along the way. In the end it worked out.

Congratulations you now have ClockworkMod Recovery (CWM) and better yes the power to backup/restore ROMs and install custom ROMs such as CyanogenMod

To get back into recovery you have two methods:

  1. Access the Android Terminal Emulator and “su” into superuser and type: reboot recovery
  2. Power off your phone and power on again holding the volume up, center button and power button. Once you see a logo on the screen release the power button and continue to hold volume up, and the center button. Welcome back to the CWM Recovery Menu