[Android General] iwhitney96:
Update: I have added a guide on how to root GSM Galaxy Nexus (Maguro) to the guide.

There are already some guides on how to root a galaxy nexus on a mac, but I found a lot of them confusing and hard to follow. After a few hours and multiple guides I finally rooted my galaxy nexus. I decided to compile a few of the methods that I had used and had worked. I take no credit for the materials used and they are all property of the developers that created them.

This is only applicable for Toro (LTE): If you are feeling lazy, you can do the one click method in the folder, however I recommend you do it manually, so you can learn the steps required to root a phone and will be better able to fix any issues that arrise.

You may permanently damage or break your device trying to root, unlock the bootloader of your phone, or attempting to install a custom recovery or custom rom. In following this guide you take all responsibility for your actions and will not under any circumstances hold me or anyone else responsible

Before we start:

1. LTE: Download the Android File Transfer App, and the Galaxy Nexus (Toro) Root (LTE) folder from http://goo.gl/gMUVQ

2. GSM: Download the Android File Transfer App, and the Galaxy Nexus (Maguro) Root (GSM) folder from http://goo.gl/97mFn

2. Fully charge your Galaxy Nexus

First, we have to unlock the bootloader. Unlocking the bootloader will wipe all of the data on your phone, so back up your contacts, pictures and other app data. Unlocking the bootloader will allow you to root and load custom roms onto your phone.

1. Turn on Usb Debugging by going into Settings and then Developer options. This will allow your mac to communicate with your phone when connected via the USB cord.

2. Open Terminal on your mac by going to applications and then utilities.

3. Connect your phone to your computer using the USB cable that came with your device

4. With the rooting kit downloaded to your desktop, enter the following into terminal, hitting enter after each line.

LTE:

cd /users/
cd [INSERT YOUR USERNAME OF YOUR COMPUTER HERE]
cd desktop
cd toro_root_4.0.4

GSM:

cd /users/
cd [INSERT YOUR USERNAME OF YOUR COMPUTER HERE]
cd desktop
cd maguro_root_4.0.4

This will direct terminal that all of your following commands will be executed with things in that folder. Alternatively, you can pick up and drag the folder on your desktop into the terminal window, which will accomplish what the above lines of code accomplished.

5. Now we will instruct the phone to reboot into the bootloader. The boatloader is what launches the operating system of the phone. Enter the following into terminal and hit enter.

GSM and LTE:

./adb reboot bootloader

Your screen will turn black and in a few seconds will load into the bootloader, which looks like this:

6. Now to unlock the bootloader, enter this line into terminal and hit enter.

./fastboot oem unlock

7. A dialogue window will pop up, warning you that your warranty is voided if you unlock your boatloader. If you still wish to continue, use the volume up button to move to the yes button and press the power button to accept and have your entire phone wiped. Also, from now on, in the bootloader you use the volume up and down button to change your selection and the power button to select something. If you are having second thoughts hit the no button and you will be restarted with no harm done.

8. The phone will now take a while to perform a factory reset. After 5 or so minutes it will reboot to a completely new phone.

YOUR BOOTLOADER IS NOW UNLOCKED

Now on to the rooting section of this guide:

1. Because your phone was just reset, you need to turn on USB debugging again.

2. Now we we will enter the commands to root the phone. Rooting your phone consists of loading Su or superuser onto your phone which gives you superuser access on your phone. Superuser access is the equivalent of an administrator on a computer, they can load anything onto the computer, while the normal user can only do certain things. Think of Superuser access as the access that the IT guys at work have. Enter the following code into terminal and press enter. The username of your computer, which is next to the picture of a house in finder.

LTE:

cd /users/
cd [INSERT YOUR USERNAME OF YOUR COMPUTER HERE]
cd desktop
cd toro_root_4.0.4

./adb push su.zip /sdcard/

This takes the su.zip app in the folder on your desktop and moves it to your phone.

./adb reboot bootloader

This restarts your bootloader.

GSM:

cd /users/
cd [INSERT YOUR USERNAME OF YOUR COMPUTER HERE]
cd desktop
cd maguro_root_4.0.4

./adb push su.zip /sdcard/

This takes the su.zip app in the folder on your desktop and moves it to your phone.

./adb reboot bootloader

This restarts your bootloader.

3. Now we have to install a custom recovery, Clockworkmod. Clockworkmod replaces the recovery on your phone. The recovery on a phone is a separate operating system that you can load into if the Android OS fails. Clockworkmod is a new recovery that allows you to load custom roms, install programs at the system level, perform nandroid backups, and restore nandroid backups. Nandroid backups copy your system and back them up, so if something goes wrong, you can restore to that moment in time. So here is the code to install clockwork mod:

LTE:

./fastboot flash recovery recovery-clockwork-5.5.0.4-toro.img

GSM:

./fastboot flash recovery recovery-clockwork-5.5.0.2-maguro.img

GSM and LTE:

4. Now that you have installed "flashed" Clockworkmod, we need to go into recovery mode. To do this move the volume up button until you see recovery mode in the red arrow at the top. It will look like this:

Depress the power button. Congratulations, you are now in Clockworkmod. Move to the option install .zip from sd card and select it using the power button. Then select choose .zip, and navigate to the su.zip file. Select it, and wait for it to install. Then go back until you find the option to reboot. Reboot. The first boot up may take a while, so have patience. If it takes more than 20 minutes, pull the battery.

5. Congratulations! You are now rooted. Go to the Play store and download clockworkmod. Open the app and Flash Clockworkmod recovery, and then backup current rom, in other words perform a Nandroid backup.

Flashing a custom Rom

GSM and LTE:

1. Now to flash your first custom rom.

2. Download your rom either onto your phone or computer.

3. If you download it to your computer transfer it to your phone using Android file transfer.

4. Perform a Nandroid backup

5. Go into Rom Manager and Reboot into Recovery

6. Wipe data/factory reset and Wipe cache partition. Then go into advanced and Wipe dalvik Cache.

7. Now we have to Install zip from sdcard and choose zip from sd card and select your custom rom. Wait for it to install and then reboot your system. It will take a little bit of time to reboot.

8. Enjoy