How to root & install a custom ROM on the AT&T Nexus S running Android OS 2.3.4 (Windows or Ubuntu 11.04)

I grabbed one of the free Nexus S phones that Best Buy was giving away, and since for my last phone I was too far into using it before I thought about rooting, I wanted to be sure to start this one off right, so I literally rooted before I even put the sim card in. This was my first time rooting, so I still had to synthesize the method from a bunch of sources, filter out the sketchy sounding “download my super cool ROM from my .ru server and you’ll get 8 times the battery life” posts, and fill in the gaps with educated guesses. The actual process itself is really simple, looking back at it. This basic process will probably work for most Android phones if you get the right recovery image and ROM for your phone.

I basically followed this guide. Here’s what I had to figure out:

There are four things you must do to unlock and root this phone: Unlock the bootloader, install the recovery ROM, install the OS mod you want, and root. You have to do at least the first 3 things in order, as well as their substeps, and there’s more than four steps listed below because some of the stuff is preparatory stuff.

    Unlock your bootloader

  1. Installing the android SDK, which is done by grabbing the right file from here and following the extensive instructions. You’ll need the SDK core, one of the Android platforms, and perhaps a third-party addon for your phone and, for Windows, the USB drivers. You’ll need to get the fastboot tool separately, and then add #AndroidDev PATH
    export PATH=${PATH}:/AndroidSDK/tools
    to your .bashrc and then run the following: gksudo gedit /etc/udev/rules.d/51-android.rules Add SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666" to the file which should be blank to start with. If your device isn’t from Samsung, substitute your device code from here for the “04e8” string above. Then you can restart the Linux device manager so it recognizes your device by running sudo /etc/init.d/udev restart

    • I had a problem connecting via fastboot on Windows, so I used my ubuntu laptop for this, if you can get fastboot devices to show your device on Windows, though, you should be able to follow the rest of this with no problems.
  2. Getting into recovery mode
    • Power the Nexus S down, and hold Volume Up & the Power button until booted into the bootloader.
    • Connect the Nexus S to the computer via USB.
  3. unlocking your bootloader, which is simply done by running sudo ./fastboot oem unlock or just fastboot oem unlock from a Windows terminal. This will wipe the phone, so have the files described below available but not on the phone.
  4. Install the recovery image (re-flash the recovery ROM)

  5. Finding the right recovery image, which is what lets you flash custom ROMs, get root, etc.
    • The recovery image is like the OS for the mode you boot into when you press volume up and hold the power button down while booting the phone. There’s a bewildering array of recovery images, with different version numbers and I have no idea how to go about finding the most recent version for your device. I used the 4014-orange.img from this thread(not the 4G version, since I’m on ATT). Those links will probably die, so if anyone reads this and can’t find a recovery image they feel comfortable using, download an earlier version for your device from here and presumably you could do further updates by downloading the ROM manager app from the market once you’re rooted, or let me know and I’ll send you the exact file I used.
  6. Flashing the recovery image to your phone with sudo ./fastboot flash recovery [name of your recovery image] or fastboot flash recovery [name of image] on Windows Be sure you’re either in the directory where fastboot and the image are located, or you’ve made the necessary modifications to your PATH.
  7. Install the OS you want

  8. Flashing the system ROM (as opposed to the recovery ROM)
    • Get the ROM you want from CyanogenMod or another trusted source. This is the actual modified OS for your phone. You probably could root first, then use ROM manager to install your desired mod, but I didn’t do that.
    • Get Google Apps, if they weren’t included with your ROM (they aren’t with Cyanogen).
    • Root your phone

    • Get the su utility. This lets you get root access via the shell and is required for rooting your phone. I used this one, but this would also probably work.
  9. Move those 3 .zip files to your phone’s storage (internal drive for Nexus S or SD card for some others) then select recovery from the menu once you’re booted into recovery mode. You might want to do a backup at this point. You should see the Google logo briefly appear then see an Android with an open box inside a triangle. Press the volume buttons and the power button until you see another menu(sorry for being vague here, up+power, down+power, and pressing the volume straight down+power eventually gets me the screen, but I have no idea what the “proper” keypress is supposed to be.) Do a wipe/factory reset, do a wipe cache, then select install .zip from SDcard, then choose .zip from SDcard. You should see the three zip files you added above. I don’t think it matters if you do su or clockworkmod first, but I did clockworkmod, then google apps, then su.
  10. Reboot your phone and enjoy
    • Depending on which mod you installed, you may or may not have superuser installed. If not, just download it from the market and continue setting up your phone
    • You might like to try Wifi Tether and some of the backup utilities from the market, which can back up user data as well as just the APKs.

I’m hoping for better battery life, personally, but overall the ROM looks about as nice and polished as the stock does. You can do things now which will compromise your user experience, so be careful and keep backups. As should be clear from the above, I’m nowhere near qualified to troubleshoot any problems you encounter while doing this, so please direct any technical questions to the XDA Developers Forum. Here’s a few threads I found useful:

One thought on “How to root & install a custom ROM on the AT&T Nexus S running Android OS 2.3.4 (Windows or Ubuntu 11.04)

  1. Hi,
    Thank for your post. I want to run device specific file(HTC PG762 android-os-2.3.4) on sdk/any tool.
    How can it possible in sdk. I have system.img, userdata.img, recovery.img, boot.img,radio.img,,..ect of this specific device image file(HTC PG762).

    Could guide me how to run this file on sdk or any tool. What kind of changes required before run this image files.

    Appreciated your help

Leave a Reply

Your email address will not be published. Required fields are marked *