Rooting Android Devices
Android is built on Linux. In Linux they are different users but the super user is called
root. This usr can perform any operation
on the Android device. The process is enabling the
root on the device is called
rooting. Once a device is
rooted you will
have full root access to the device.
Check for root access
To check for root access, first open a shell on the device and change to the root user by running the
and then then run the
su command, switch user :
If the device is rooted your prompt will change into a
# symbol, if not you will get an error that
the command is not found.
By default the Android emulator is already rooted, it give you root access to the device.
Rooting an android device
Rooting an Android devices requires a few steps :
- Unlocking the boot loader
- Install recovery software like
- Install the
Unlocking boot loader
By default most devices comes with their boot loaders locked. In order to root the device the boot loader needs to be unlocked first. The process to unlock the boot loader is dependant on the device manufacturer.
The Google Nexus phones are the easiest to unlock since Google seems to lax the rules on rooting the device. Some devices like Sony and Huawei requires a vendor provided code to unlock the boot loader.
Boot the device in fastboot mode
Depending on the device, they different key combinations used to enter the fast boot mode. Check with the device manufacturer.
- Connect the device to the computer
- On most devices hold the
Power Buttonwhilst the device is off
- The device will boot to the
fastboot devicesto list devices connected in fastboot mode
fastboot oem unlock
If the process is successful the device will be unlocked.
Unlocking a boot loader on Google devices wipes all the data from the device. Backup the data before performing this operation.
The device might go into a loop and continually keep restarting, check on
http://www.stackoverflow.com for solutions.
Installing recovering software
The Android system comes with a recovery partition. This is used when making updates to the device without wiping the user data. The default recovery that comes with most devices can only perform limited functionality. In order to root a device, a custom recovery is required. Custom recovery options have options like creating restore points, applying unsigned updates, wiping data selectively, taking backups, copying data to the SD card and many more.
They are different recovery software packages but the popular ones are :
Installing TRWP(Team Win Recovery Project)
On Samsung devices you can use the
Heimdall software to for installing th recovery software on your phone.
- Download the TRWP recovery tarball
- Download the IMG for your specific phone version from the TRWP website.
- Download Odin
- Put the device into
download mode. On Samsung devices you press the
- Connect the usb device when the phone reboot in download mode
- Accept the warning with the
Volume Upkey to continue
- If everything went well Odin’s
ID:COMwill turn blue to show that its successfully connected.
APand select the recovery IMG image from the previous step.
APis under the
Auto Reboot and
F. Reset Time are checked under the
Startto begin the recovery. You should see
PASSafter a few seconds if everything goes well and the phone will restart.
- Download the from here
- Copy the zip to device using adb with
adb push <path to supersu zip> /sdcard
- Reboot the phone into recovery mode by pressing the
Installfrom the TWRP menu
- Choose the
Updated Super Su Zipand start flashing the device.
- Reboot the device once the install is complete
SuperSuwill be added to the home screen
- Test the installation by using adb, and run
adb shell. Once on the prompt, type
su. If everything worked you should now be presented with the root prompt. The root prompt have a
Congratulations you have rooted your Android device.