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: http://downloadandroidrom.com/file/GalaxyS4/loki/loki_flash or from Github: https://github.com/djrbliss/loki
You will need to download the recover.lok for Galaxy S4 from: http://downloadandroidrom.com/file/GalaxyS4/SGH-i337/recovery/CWM/recovery.lok
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.
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:
- Access the Android Terminal Emulator and “su” into superuser and type: reboot recovery
- 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
20 replies on “How To: Install CWM Recovery on AT&T Galaxy S4 – SGH-i337”
Hi nice tutorial,
when I try to move the loki files to the data directory they dont seem to appear(even though it says “file copied to \data\local\tmp\”) and they dont show up in the emulator. Do I need special permission to add files to the data directory or is there another way of copying the files there?
Its very possible that your phone had already been patched against this as were many from the provider of your service.
Please have a look ever at: http://galaxys4root.com/galaxy-s4-root-faq/ Max Lee aka @zedomax is a good guy, knows his stuff and provides lots of into on these phones.
I wish I had more info, but I can point you in a solid and trusted direction… Best of luck to you friend.
Ummm i have the device entitled but i cant do chomod 775 * so i do chmod 755 * also when i do ./loki_flash recovery recovery.lok it says the version of loki doesnt match my device
In the terminal i get as far as the part where i am supposed to enter “chomod 775 *” no quotes of course and it wont work…ive tried spaces no spaces some spaces…it just says not found…what am i doing wrong?
I think you’re not supposed to type anything after the 775. I don’t know if the instructions are just mistyped or what, but I entered “chmod 775” and it worked fine…
im also stuck at where i have to type chomod 775 *
i get the not found response. what do i do please?
i have a sgh-i337 and teminal emulator say loki_flash not suport by corent version
my basebond ucufnb1
i have a sgh-i337 and terminal emulator say did not match
my basebond is ucufnb1
i have a sgh-i337 at&t MK2 android 4.3 and teminal emulator say loki aboot version does not match device
So every time I try typing in, “/data/local/tmp” to get to the files, my phone always says, “can’t execute: Is a directory 126”
What does that mean? Am I doing something wrong?
I have a SGH-I337 running 4.4.4
Any advice would be fantastic! Thanks!
I cant figure out the problem, but I found a tutorial for flashing with Odin which might help some people here – http://www.odindownload-com.co.uk/samsung-faqs/
thanks for the share – Jermal
Error-“loki aboot version does not match device”
how to fix??
hello sir i am Raghav Bhagwat from India,i have a samsung sgh i337(s4),i dont know how to install custom rom but i flashed wrong firmware from system recovery that rom installation faild.i do restart it showing samsung and a unlocked padlock,custom and not booting.then i flashed so much firmware and custom recovery in Odin that showing fail many many times.So my phone soft bricked,please help me what can i do.Also sorry for my english.And tell me then how can i install cwm recovery through system recovery.(no OS in phone.s4 at&t i337)
You may be able to use the following for a restore http://jermsmit.com/how-to-unroot-and-go-stock-galaxy-s4-att/
Any idea if this Loki method has any constraints for the GS4 to carry only specific builds? Mine is FNI1 and wanted to check before hand to stay SoftBrick-Immune.
Appreciate for sharing this.
Hello, I tried this this method on my at&t 1337 S4 running Lollipop 5.0 and when I try to run the loki script is gives me a message saying “error: only position independent executables (PIE) are supported.” What is the problem here?
Cristian, I’ve bumped into the same problem. Do you remember, how’d you’ve solved it (if)?
when i try using the “./loki_flash” command it says “cant execute permission denied”
Thank you Bro This Trick Work For me my mobile