Gaining the root access unlocks the door for some serious customization. You get to totally own the devices as you become the superuser of the system when you root the device, which is why many of us just have to root our Android device.
Some of the reasons behind rooting a device are to take proper with-data backups of apps and games which makes life easier when you switch ROMs, but there is much more to it than just data backups. You can even tweak the system settings to your benefit.
Xiaomi has released the MI A2 after the spectacular success of the Mi A1 from last year. Needless to say, those who prefer a simple and pure stock OS over the company’s MIUI OS are preferring the Mi A2 over other other Android devices from Xiaomi and other popular OEMs.
Related: Best Xiaomi phones 
Anyway, we think whatever be the reason behind your decision to buy the Mi A2, you may want to root the device for a number of reasons. You will need to unlock the bootloader of your Mi A2 first for this, followed by installation of TWRP recovery, which facilitates installing root.
So, without further ado, here’s how you can root the Xiaomi Mi A2.
Do not try anything given on this page if you do not know completely what you are doing. In case any damage occurs, we won’t be held responsible.
Xiaomi Mi A2 TWRP Recovery
Download the TWRP recovery file for your variant of the Xiaomi Mi A2 from below.
- Mi A2 TWRP recovery: TWRP-3.2.3-jasmine-20180804.img
- Mi A2 Lite TWRP recovery: Not available at the moment (September 1)
This TWRP is the work of developer TingyiChen over at XDA, whom you shall thank for his work if it helps you.
Xiaomi Mi A2 and Mi A2 SE Root
Here’s an easy step-by-step guide to help you install TWRP recovery on your Xiaomi Mi A2. You can use the TWRP recovery to easily gain root access on the device.
Before you try the guide below, let us tell us what the guide does in short. You can follow the instruction set in the detailed guide below to do all of this.
- First, we find the non-active partition and install TWRP in that partition.
- Then we convert the non-active partition to active and reboot to recovery mode to access TWRP.
- Next, we installed either of root or DM verity disabler file.
- Now that our job with TWRP is done, we set the originally active partition back as active, and reboot to Android.
With the above in your knowledge, let’s see the detailed guide below to install TWRP and then root the Mi A2.
- Make sure that you’ve unlocked the bootloader for the Mi A2 before proceeding.
- Download the required files:
- Connect your Mi A2 to the PC using the USB cable it came with.
- Transfer all the downloaded file (TWRP, Magisk, and DM verity disabler) to your device. Do keep a copy of TWRP IMG file on your PC too. Keep the Mi A2 connected to PC.
- Make sure you have enabled USB Debugging on your Mi A2, as explained in the bootloader unlock post above (step 1). You may need to re-do it after unlocking the bootloader.
- Now open a command window inside the folder where you have the TWRP file from above. For this, go that folder, and then type cmd in the address bar of that folder’s window, and then hit the enter key. A command window will open up, and its location will be that folder.
- Boot your Mi A2 into bootloader/fastboot mode. For this run this command:
adb reboot bootloader
Find the active boot slot of your device (may differ per user). The Mi A2 uses A/B partitioning system, meaning either of A and B partition is active. You have to install the TWRP on the non-active partition, so here’s what to do. Run the command below to find active partition:
fastboot getvar current-slot
- Not down the active partition. For the purpose of this guide, let’s assume it is A partition that is active. Which means B is the non-active partition, and we need to install TWRP on the B partition. (If the active partition on your device is B, then you need to install TWRP on A partition.)
Install TWRP recovery on the B partition of your device by running the command below. To run a command, simply type this in the command window and then hit the enter key.
fastboot flash boot_b <name of twrp file here>.img
Tip: The command ends with the filename of the TWRP file, so change the filename in the command as required.
- Now set the non-active partition (B, in our case) as the active partition by running the command below. (If your active partition was B, then make A active partition now.)
fastboot set_active b
Careful! Hold the volume up button now, and while holding the Volume up button, run the command below to reboot into recovery mode to access TWRP first before starting to Android.
- Enter the password or PIN you are using to let system decrypt in recovery mode and get to TWRP recovery. (It won’t ask if you are not using any PIN or password on the device.)
- You will see TWRP recovery now. When asked to ‘Keep System Read only?’, tap on the ‘Keep Read Only’ button to not allow for system modifications.
- Time to root the Mi A2! You have to install the root file (Magisk ZIP file) now. Go back to the home screen of TWRP and tap on Install, > then select the ZIP file, Magisk-v16.7.zip, and confirm on the next screen.
- In case you don’t want to root the device, be sure to install the DM verity disabler file now (in place of Magisk file) to get the Mi A2 to boot normally (prevent from bootlooping).
Activate the slot A back. Yes, with TWRP installed on B partition, it’s time to set the originally active partition, A in our case, active again.
→ For this, in TWRP, press the home button, and then Reboot > and activate slot A now.
- Reboot now and your Mi A2 will start to Android and will be rooted too. You can verify root access on your Mi A2 using a root checker app.
Do let us know if you need any help over the Mi A2 root matter.