[Nexus S Android Development] Jonathon Grigg:
May NOT work for 2.3.3, if attempting on 2.3.3 use old part 1! - Will wipe all data though

Windows ONLY!

Hey guys, rooted my Nexus S today, and decided to write a thorough, detailed guide on how I did it, as none of the guides I had found had everything detailed. I came across a few problems, and all of this is in the guide. I successfully completed it on my Nexus S running 2.3.2, so any version below that will also work.

The original guide was made by AllGamer, and can be found here. I followed this guide, and added things when I found it was needed :)

The

full guide with everything (including links, pictures)

can be found on my site, Complete Android.

New info: Upon finding another thread over at XDA (http://xdaforums.com/showthread.php?t=931865) it has been realized that you can root your Nexus S without unlocking the bootloader, and therefore not loosing your data on the SD card. Part 1 for the new method is still the same, but choose the new Part 2!

What you will need:

Nexus S (obviously)

Android 2.3 SDK

USB Cable

PDAnet (for drivers)

Clockwork Recovery Image

Superuser

Part 1

Download the Android 2.3 SDK (or direct from Google here, 32MB).

Once it has finished downloading, unzip it, and run the SDK manager.

Select whatever components you wish to install, but you MUST make sure you install Google USB Driver (Available packages > Third party Add-ons > Google Inc. Add-ons > Google Usb Driver package, revision 4) otherwise this guide will not work!

We must now install the Google USB Driver, or the phone will not be recognised as a device other than a mass storage device.

Connect your Nexus S to your computer, and put it in USB storage mode.

Put it in USB Debugging Mode (Settings > Applications > Development > USB Debugging)

Windows should now recognise your Nexus S when you plug it in, and ask to install drivers. It probably won’t find anything, so we need to help it manually.

(Installing drivers manually varies between Windows versions, so please refer to http://developer.android.com/sdk/win-usb.html if you are having trouble). Launch Device Manager (you can find it in Control Panel), find Other Devices, and listed under that heading, you should find Nexus S. Right click, and select Update Driver Software. Click Browse my computer for driver software, find your SDK folder, then the google-usb_driver folder inside it, click OK, then Next. This should install the USB driver successfully. Reboot your computer.

﻿Power off your Nexus S, connect it to your computer via USB cable, and boot it into the Bootloader Interface (you can do so by holding down the Power and Volume Up buttons at the same time).

It should say LOCK STATE – LOCKED, in white just above the green Android. You are now ready to move on!

Part 2 - Fastboot oem unlock method - WIPES ALL DATA!

We now need to install PDAnet on our PC so that Windows can see our Nexus S when we are using the Command Prompt. Install PDAnet from here, select Samsung when asked about the Manufacturer, allow the driver to be installed (because the driver is unverified, don’t worry about this!). Follow along with any other instructions. You should be set now.

With the latest SDK version, some tools have been relocated to another directory, so we need to make a copy and move them back. Navigate to the directory where you unzipped the Android SDK file in part 1. Inside it, go to the platform-tools folder, and copy both AdbWinApi.dll and AdbWinUsbApi.dll. Go back to the main Android SDK directory and find the tools folder. Paste these two files in there, and we are all ready to use ‘fastboot oem unlock’ (the rooting command) now.

Open a command prompt window (Start > Run > cmd.exe).

Change to the tools directory within your Android SDK folder by using the following command (without the quotes and replacing *YOUR SDK* with the path to your Android SDK folder) ‘cd c:\*YOUR SDK*\tools’.

Make sure your Nexus S is still in the Bootloader Interface (refer to step 9, part 1 of it isn’t).

Now in the command prompt, type in (without the quotes) ‘fastboot oem unlock’.

Now turn your attention to the phone, and read through the new information displayed on the screen. Using the Volume keys select Yes, then press the Power button. This will WIPE EVERYTHING! I bear no responsibility for any lost data on your phone!

If everything is successful, on your phone, the LOCK STATE should now read UNLOCKED, and on your computer, the command prompt window should say something like this:

Download the Clockwork Recovery image (here if you don’t already have it) to your Android SDK tools folder (*Android SDK*\tools).

Rename the newly downloaded Clockwork Recovery image to ‘recovery.img’ (no quotes).

Now we need to flash it to our Nexus S, so enter this command into the Command Prompt (make sure it is in the Androis SDK tools folder!) ‘fastboot flash recovery recovery.img’ (without the quotes).

If all is successful, the Command Prompt window should look something like this now:

Download the superuser app to the Android SDK tools folder.

Power on your Nexus S, leaving it connected to USB.

Mount the USB storage, and drag and drop the superuser .zip file you just downloaded into the root of the internal SD card (so Computer > *Device Name*, not in any other folders!). It should look something like this:

Power off the Nexus S, and return to the Bootloader Interface (step 9, part 1).

Select Recovery using the Volume buttons, then the Power button.

The phone should reboot into Clockwork Recovery, but if not don’t panic, just repeat steps 9-12, including downloading a new copy of the file (mine only worked the second time around, don’t worry!)

Using the Volume buttons and Power button, select install zip from sdcard.

Select choose zip from sdcard.

Select the su-version#-signed.zip file you downloaded earlier and apply it.

Select yes (there are lots of nos).

Confirm it says something like this: install from sdcard complete

Select Go Back.

Select Reboot. (You will now also have an unlocked padlock when you boot up)

Done! You now have to set up your phone again like when you first got it, but it will be rooted now.

New Part 2 - Does NOT wipe everything - Keeps a locked bootloader

Make sure Part 1 is completed.

Make sure you have downloaded the Clockwork Recovery file and the Superuser file.

Move the Clockwork Recovery file to your tools folder within the Android SDK folder, and rename it to recovery.img (for simplicity).

Connect your Nexus S via USB to your computer and mount it as USB storage. Copy across the Superuser file to the top level of your sdcard. (So the first window you see, not in any other folders. The sdcard is just where all the files are stored, don't worry about it too much for now).

We now need to install PDAnet on our PC so that Windows can see our Nexus S when we are using the Command Prompt. Install PDAnet from here, select Samsung when asked about the Manufacturer, allow the driver to be installed (because the driver is unverified, don't worry about this!). Follow along with any other instructions. You should be set now.

With the latest SDK version, some tools have been relocated to another directory, so we need to make a copy and move them back. Navigate to the directory where you unzipped the Android SDK file in part 1. Inside it, go to the platform-tools folder, and copy both AdbWinApi.dll and AdbWinUsbApi.dll. Go back to the main Android SDK directory and find the tools folder. Paste these two files in there, and we are all ready to use 'fastboot boot' (the boot image command) now.

Open a command prompt window (Start > Run > cmd.exe).

Change to the tools directory within your Android SDK folder by using the following command (without the quotes and replacing *YOUR SDK* with the path to your Android SDK folder) 'cd c:\*YOUR SDK*\tools'.

Make sure your Nexus S is still in the Bootloader Interface (refer to step 9, part 1 of it isn't).

We now need to use the 'fastboot boot' command to load Clockwork Recovery onto our Nexus S. In the command prompt, type in the following (but without the quotes, as always) 'fastboot boot recovery.img'

Once you are in Clockwork Recovery (it may take a couple of tries, don't panic, just redownload Clockwork Recovery, and complete steps 3 and 10, part 2) it should look something like this:

Using the Volume buttons and Power button, select install zip from sdcard.

Select choose zip from sdcard.

Select the su-version#-signed.zip file you downloaded earlier and apply it.

Select yes (there are lots of nos).

Confirm it says something like this: install from sdcard complete

Select Go Back.

Select Reboot.

Done! You should still have all your data present on your phone, and have root access!

Notes

As AllGamer said in his tutorial:

Keep this in mind! It's not because you did something wrong ;)

Also, some root apps require BusyBox to be installed, as I found out with Titanium Backup, so once you set up your Nexus S again, head on into the Market, and download BusyBox. It installed fine on my Nexus S this way, and now TB works fine.

I hope this is the best, most thorough guide you will find on rooting the Nexus S. Enjoy! Feedback is appreciated, and I will help out if you need any extra help.