Skip to content

Root Android Phone with ADB Command, Magisk & TWRP

In this guide, we will be discussing two different methods to root your Android device. Rooting is the process to attain administrative privileges over your device system files. Android community holds tons of mods and frameworks and related tricks that completely modify your phone and add new features to it. And rooting is the gateway to all these goodies. Earlier SuperSU was the lone choice for attaining root. But with the inception of  Magisk, it has become everyone’s favorite tool.

The main reason for that is the fact that it carries out all the modifications systemless-ly. That is, it doesn’t modify the device’s system partition. As a result, Google’s Safety Net won’t be triggered and the apps dependent on it will continue to function as expected. Apart from that, Magisk also holds some other benefits like the Magisk Hide feature.

This allows you to hide root from apps that don’t work on the rooted devices (like banking apps, Pokemon Go among others). Owing to all these reasons, we will be listing two different methods to root your Android device via Magisk itself. So without any further wait, let us begin with the guide. With that said, here are the 6 most popular universal root tools for Android that you should definitely check out.

Requirements

  • Make a complete backup of your Android device. Although rooting an Android device doesn’t wipe data, still, it is always recommended to be on a safer side.
  • Your device should also be having an unlocked bootloader. If that’s not the case, please refer to our guide on how to unlock the bootloader of Android devices.
  • Set up the Android SDK Platform Tool on your PC.
  • Similarly, enable USB Debugging on your device from Developer Options. This will create a debug bridge between your device and platform tools to successfully execute ADB Commands.
    usb debugging
  • Download the latest Magisk Manager APK and Magisk ZIP. Transfer it to your device’s internal storage or SD Card.

With the requirements now clear, here are both the methods to root your Android devices.

Method 1: Root Android Phone via TWRP

First off, to root your Android device via recovery, you will need a working TWRP image for your device. Please don’t use any other device’s recovery. You will definitely end up in a bootloop. If there isn’t one for your device, then skip to Method 2. Also, make sure the recovery has been installed on your device. We have a detailed tutorial on installing TWRP on Android. Now with the instructions clear, let us proceed with the steps to root your Android device.

Steps to Follow

android root twrp

  1. Boot your device to TWRP Recovery. Either use the specific hardware key combinations for that or execute the below command. For the latter, head over to the platform-tools folder and type cmd in the address now, and hit Enter.
  2. Now enter the given command in the Command Prompt:
    adb reboot recovery
  3. Your device will now boot to TWRP Recovery. Go to Install, browse to the Magisk ZIP file and perform a right swipe to install it. This zip file is needed to root your Android device.
  4. Now go to Reboot and tap on System. Once your device boots up, install the Magisk Manager APK.
  5. That’s it. Open the app and you should now see the message that Magisk is up to date (see screenshot below).

With that, you have successfully rooted your Android device. Let’s now check out the steps to do so via fastboot commands. On that note, also have a look at 10 useful Windows command prompt tricks that you should be aware of.

Method 2: Root Android with ADB & Fastboot Commands

If there isn’t any working TWRP for your device or you don’t wish to install one for whatever reason, then this method might come in handy. For this to work, you will be needing the stock boot.img file of the same version which is currently installed on your device. You could extract the same from the stock firmware of your device. Just make sure that there is no version mismatch. Otherwise, bootloop is evident.

install magisk android

  1. Install Magisk Manager APK on your device. Open it and tap on Install next to “Magisk is not installed” keyword. Again tap on Install in the next pop-up.
  2. Now tap on Select and patch a file. Select the boot.img file and wait till Magisk patches it.
  3. Connect your device to PC via USB cable. Head over to the Downloads folder on the Internal Storage, copy the magisk_patched.img file and transfer it to the platform-tools folder on your PC. This file is needed to root your Android device.
  4. Now, enter cmd in the address bar of platform-tools and press Enter. This will launch the Windows Command Prompt window. Enter the below code to boot your device to fastboot or bootloader mode:
    adb reboot bootloader
  5. Your device should now be boot into fastboot mode. Execute the following command to flash this patched boot image onto your device:
    fastboot flash boot magisk_patched.img
  6. It should be successfully installed on your device within a matter of seconds. You could now reboot your device via the Power key or the below command:
    fastboot reboot

That’s it. You have now successfully rooted your device via TWRP Recovery. Now go ahead and dive deep into the mods community and give our device a completely new makeover. There are tons of Magisk Modules, Xposed framework, and Custom ROMs, all waiting for a place on your device. Go and give them a shot!

Must Read: How to Android Lock Screen PIN & Pattern via ADB

We have compiled quite a huge list of ADB, ADB Shell, and Fastboot commands with detailed explanations to all commands you may ever need to use.

4 thoughts on “Root Android Phone with ADB Command, Magisk & TWRP”

  1. Followed 2nd step and everything went right but when checked for root it says that root is not properly installed on your device why so…..??

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.