Monday, December 5, 2011

Beginner's Guide to Cyanogen Mod on Epic 4G (Samsung Galaxy S SPH-D700)

UPDATE: This guide also works with the new Cyanogen Mod 9 release, which is based on Android 4 Ice Cream Sandwich.

Based on Sprint's depressingly slow release of Gingerbread OTA (over the air) updates for the Epic 4G (aka Samsung Galaxy S SPH-D700), it looks like this phone will be considered EOL (end of life) in the very near future, despite being barely a year old (that's like, what... 7 years in cell phone time?). It is, therefore, very unlikely that us Epic owners will ever receive an official update to Android 4.0 Ice Cream Sandwich.

However, thanks to the open source nature of Android and some extremely clever community members, we can now use the awesome, fast, feature-filled Cyanogen Mod (CM) on our phones. CM7 has only just recently reached 'supported' status on the Epic 4G, while international versions of the phone have had support for some time.

Preparation

To get started, we need to download some tools:
1. Odin, which is a Windows-only (boo) utility for flashing firmwares on the Epic 4G. Mac/Linux users can try Heimdall, but I won't be covering that in this tutorial.

2. A rooted kernel for Samsung's official Gingerbread ROM. This will prep your phone for all of the shenanigans we'll be getting into. It also includes some nice community-provided goodies, like a fix for the keyboard's habit of dropping double-tapped letters.

3. ClockworkMod, a special bootloader that now works with the Epic 4G. Once you get this guy installed, you never have to use your computer for this kinda stuff again. You can just flash in new ROMs (like CM updates) directly from your phone's SD card.

4. A Cyanogen Mod image optimized for the Epic 4G. This is the one I used, but since then, the epicmtd (the codename for the Epic 4G) has become an officially supported device! That means you can always get the latest stable and/or nightly builds from the official CM distribution source. One thing to be aware of: CM10 requires repartitioning your phone, so once you go to it, you can't go back to CM9/ICS or earlier without returning to stock first. As long as you stay with CM9 or earlier, however, you can swap between them without doing a full reversion.

5. Samsung's USB Phone Drivers. Without this driver, Odin will fail to see your phone :(

6. G-Apps. They're named in this fashion: gapps-[android revision]-[date]-signed.zip. Find the one that matches your CM version (ICS corresponds to CM9 while JB corresponds to CM10) and has the most recent date.

You'll also need a USB-A-to-microUSB cable that is SHORTER than the one that came with your phone. For some strange reason that I won't go into here (it has to do with impedance of the wire :O), the 6-foot cable that is shipped with the phone will almost always fail the process, leaving you with a semi-bricked phone. Get one like this instead.

Ok, once you've collected all of your tools, we can get started.

Installation

1. Install your USB Phone Driver and unpack your Odin zip file. Inside the resulting folder, you should have your Odin executable (ends in *.exe), Odin3.ini and a *.pit file (mine is victory_8G_100528.pit).

2. Plug your USB-A-to-microUSB cable into your computer, but not into your phone. Now, power off your phone, slide open your phone's keyboard and hold down the number 1 key and the power button while plugging in the microUSB cable. It should boot into this screen:
3. Now, open Odin. It should look something like this:
Make sure, under 'Option' on the left, the box next to 'Re-Partition' is NOT checked. Then, on the right, click the button labeled PDA and navigate to your Samsung recovery ROM (#2 in the tools above). Choose it and, back in the main window, click the big button labeled 'Start.'

Some messages should run through the window on the bottom left of the Odin window and, if everything went well, it should end up like this:
and your phone should reset itself and boot into the Samsung ROM.

4. Now, power off your phone again, unplug it from your computer and perform step #2 again to get it back into the recovery state.

5. Back in Odin, click the PDA button again, but this time, navigate to the ClockworkMod ROM (#3 from the tools above). Choose it and, back in the main window, click the 'Start' button again. The message window in the bottom-left of the menu should cycle some more messages and, if everything went well, it should say All threads completed. (succeed 1 / failed 0) and your phone should reset itself again.

At this point, we're finished with Odin (forever), so go ahead and close it out.

6. From now on, you can flash anything you want directly from your SD card, which is awesome. So, put your phone into USB Mass Storage mode (I had to unplug my USB cable and then reconnect it, then it prompted me as usual) and drag your CyanogenMod ROM (#4 from the tools above) to the root (top level directory) of your SD card and rename it to 'update.zip' (very important).

Now, on your phone, tap the button labeled "Disconnect storage from PC" to unmount it from your computer and power-off your phone. Once it's completely turned off, power it back on, but when you do, press and hold the power button, the camera button (i.e., the button below the power button) and the 'Volume Down' button on the other side of your phone to enter the ClockworkMod bootloader. It should look something like this:
Using the volume up/down button to navigate, select 'Apply sdcard:update.zip.' It will ask for confirmation and warn you that it cannot be undone. Confirm your selection and it will begin installation, which should look like this:
When it's all finished, it will put you back in the bootloader, where you can choose 'Reboot system now':
If everything went well, you should see the CyanogenMod7 boot screen, like this:
Congratulations! Take a deep breath and give yourself a pat on the back. We just have a few more things to add and then we'll be done! You can proceed to step #7.
If you just keep seeing the CyanogenMod7 boot screen over and over (like I did), then you've encountered the "bootloop" error, which is no big deal. Just boot back into your ClockworkMod bootloader, choose 'Mounts and Storage' from the main menu, and then 'mount USB storage' (you may have to unplug/replug the USB cable from your computer if it doesn't recognize it straightaway). Once it mounts on your computer, you can try to redownload your CyanogenMod image, rename it to update.zip and replace it on the root of your SD card. When it's done copying, select 'Unmount,' tap the 'back' button to go back to the bootloader, select 'wipe data/factory reset' and then flash it again to CM.
7. Once you successfully reach the CM desktop, activate USB Mass Storage mode via the pulldown main menu. Once your SD card mounts on your computer, create a new folder in the root directory (you can call it whatever you want, but I'm going to call it 'updates'). Note: you can also delete your CM image at this point, if you want to free up the space. Put your G-Apps into your new directory and boot back into your ClockworkMod recovery.

Once you're there, choose 'Apply update from zip file on SD card,' then 'choose zip from SD card,' then navigate to your newly created directory ('updates' for me) and choose your gapps zip. When it finishes, choose 'Reboot' from the bootloader and you should be all set!

Whenever new updates for CyanogenMod are released, simply rename them to 'update.zip' and place them on the root of your SD card, then run the update from ClockworkMod's bootloader. < Note: since this was written, you can update straight from CyanogenMod without using ClockworkMod by going to System Settings > About phone > CyanogenMod updates. Here, you can browse and download updates and apply them on the next reboot.

16 comments:

  1. I went through every step to the T and it said in cwm that the update didn't work and it was aborted. Do I have to unzip the cwm5.0.2.7 before I put it on my sd card root? I changed the entire cwm-5.0.2.7-epic4g.tar.md5 to update.zip like you said

    ReplyDelete
  2. Hi David,
    Try this copy of cwm:
    http://cmw.22aaf3.com/aries/sph-d700/root/cwm5-bml-d700.tar

    Until clockwork is on the phone, you don't need to rename anything. You should be using Odin to flash clockwork.

    Once clockwork is successfully installed, you can rename the cyanogen mod to update.zip for installing via the clockwork recovery menu.

    ReplyDelete
  3. Do i need to drag and drop the whole zip or just a file? What file am i looking for?

    ReplyDelete
  4. Hi Harrison,
    You want to put the entire Cyanogenmod ROM, which will be in the form of a zip file, onto the top level of your SD card.

    ReplyDelete
  5. cm 7.1.0 KANG 1124 New WPA Is the name of the ROM. Does that sound right?

    ReplyDelete
  6. There are tons of custom ROMs available, and that could certainly be one that would work. However, I found CM7-based ROMs to be exceedingly slow and crummy, so I would recommend moving to CM9 instead at some point. I'm currently running CM10 on my Epic 4G and have been very pleased with the performance, stability and battery life.

    ReplyDelete
  7. You can always get the latest Cyanogenmod builds for Epic 4G from this link:
    http://get.cm/?device=epicmtd

    Here is a link to the latest stable CM9:
    http://get.cm/get/jenkins/7077/cm-9.1.0-epicmtd.zip

    And here's the latest stable CM10:
    http://get.cm/get/jenkins/12604/cm-10.0.0-epicmtd.zip

    One note about CM9 vs 10 is that 10 requires a repartition that makes it incompatible with other custom ROMs that use a different partition scheme. If you're planning to try a bunch of different ROMs, CM9 is an easier place to start. If, however, you just want a good, fast ROM, CM10 will treat you well. :)

    ReplyDelete
  8. do you have to have the phone rooted? because when i click apply sdcard:update.zip i get an error saying E:Can't mount /sdcard/update.zip

    ReplyDelete
  9. @keilboring
    Yes, a root is required, but that's covered by flashing the kernel-GB-3a.tar.md5 from Odin.

    When you boot into recovery mode (by holding camera+power+vol. down), does it look like this (i.e., with the clockwork logo in the middle of the screen):
    http://3.bp.blogspot.com/-cbcDUBDZ5m8/Tt5hwfBxL6I/AAAAAAAABGk/XvqiZyYXQ-M/s1600/5.png

    If not, then clockwork didn't install properly and you'll want to go back into Odin and reflash the aforementioned kernel md5 and then retry the clockwork flash.

    ReplyDelete
  10. fixed E:Can't mount /sdcard/update.zip The problem i had was i formated the microsd with my computer instead of using my phone. after trying two sdcards formatted from my computer i decided to unmount them and let android format them then it worked fine. Installed cyanogenmod 10.0.0 and it works havent tested everything.

    Thank you so much for this guild and your time. just letting you know i think your G-Apps hyperlink is broken.

    ReplyDelete
  11. @keilboring
    Oh, nice! Congrats on getting it going :D

    Thanks for the heads-up on the dead link. I fixed it and corrected some other info that was also out of date.

    ReplyDelete
  12. tried this tutorial, phone did not auto reboot after flashing kernal. now its bricked....any way to un brick it?

    ReplyDelete
  13. @anonymous
    Hey, sorry it didn't work out for you. You should be able to reboot into the download mode (with the little digging android guy) and flash a stock image back to it using Odin.

    ReplyDelete