How to Install TWRP Recovery and Root Xiaomi Mi A1 using Magisk

Root Xiaomi Mi A1 and Install TWRP Recovery

TWRP now officially supports Xiaomi’s first Android One device. Follow this guide to easily install TWRP recovery and root Xiaomi Mi A1 (Tissot) on Android Pie and Oreo using Magisk.

The rooting scene has been pretty challenging since Google released the first generation Pixel devices in 2016. The devices brought the all-new A/B partitioning system to support seamless system updates. Overall, this was a great innovation and prevents any scenario of an unbootable device after an OTA update. But the new partition scheme brought enough obstacles for the development community to overcome. Since the release of the Mi A1 in September 2017, the developers have been trying the best to find a working solution for root and TWRP.

After a lot of testing and updates, the Mi A1 gained the official support of TWRP in 2018. Ever since then, the recovery has been constantly updated and is now compatible with Xiaomi Mi A1 running Android Pie, Oreo, and Nougat. TWRP for Mi A1 is being maintained and developed by XDA Recognized Developer nicknitewolf. An unofficial version of the recovery is also available, which supports Treble-based custom ROMs and is being maintained by XDA Senior Member Giovix92.

Root Xiaomi Mi A1 and Install TWRP Recovery

The instructions below will help you install TWRP on Xiaomi Mi A1. It will begin by temporarily booting the TWRP recovery image and then installing the image using the ‘Install Recovery Ramdisk’ option. Once installed, you can flash the Magisk installer zip file to easily root Xiaomi Mi A1.

Table of Contents

Prerequisites

  • Before you do anything, make sure to backup your device completely. You can follow our guide on how to backup Android phones.
  • In order to install TWRP and root, you must first unlock your phone’s bootloader. Note that unlocking the bootloader will wipe all the data stored on the phone. So make sure that you have backed-up all your data beforehand.
    • To do so, boot your phone into Fastboot Mode. Then connect it to the PC using the USB cable and execute the following command via the CMD/PowerShell:
      fastboot oem unlock
  • Download and install Xiaomi USB Drivers on your PC.
  • Charge your Mi A1 to at least 50-60% battery level. This shall help avoid any sudden shutdowns during the process.
  • Install ADB and Fastboot on your PC. You can also use Minimal ADB and Fastboot alternatively.

Make sure that you have fulfilled all the requirements listed above before you head below to the instructions to install TWRP recovery and root Xiaomi Mi A1.

Downloads

Note: Starting with TWRP 3.3, there’s no need to download a separate installer zip. You can simply use the ‘Install Recovery Ramdisk’ option to permanently install the recovery.

How to Install TWRP Recovery on Xiaomi Mi A1

  1. Download TWRP recovery image for your Xiaomi Mi A1.
  2. Connect your phone to the PC and transfer the downloaded file to the phone’s storage.
  3. Power off your phone completely.
  4. Press and hold the Volume Down + Power buttons altogether to boot your Mi A1 into Fastboot Mode.
    Install TWRP Recovery on Xiaomi Mi A1 - Boot into Fastboot Mode
  5. Copy the TWRP recovery image (e.g. twrp-3.3.1-0-tissot.img) file to the folder where all the ADB and Fastboot binaries are present (e.g. C:\adb).
  6. Press the SHIFT key and right-click on an empty space inside this folder.
  7. Select ‘Open PowerShell window here’ from the menu that appears.
    Open PowerShell on Windows
  8. Enter the following command to make sure that your device is being detected properly. If you’re using Linux/macOS, make sure to add dot and front-slash (./) prior to the command(s).
    fastboot devices
  9. The command shall return a device ID, along with the ‘fastboot’ message.
    Root Xiaomi Mi A1 - Fastboot Devices command
  10. Now, enter the following command to temporarily boot TWRP recovery on Mi A1:
    fastboot boot twrp-recovery-image.img
  11. Make sure to replace “twrp-recovery-image.img” with the actual filename of the TWRP recovery image.
    • For example:
      fastboot boot twrp-3.3.1-0-tissot.img
  12. The device should now boot into TWRP recovery mode.
  13. Go to the ‘Advanced’ menu in TWRP and tap on the ‘Install Recovery Ramdisk’ option.
  14. Select the TWRP recovery image file (twrp-3.3.1-0-tissot.img).
  15. Finally, swipe the button to confirm the flashing process and permanently install TWRP recovery on your Xiaomi Mi A1.

Now with TWRP installed, you can follow the instructions below to root Xiaomi Mi A1 using Magisk.

Recommended: Enable Camera2 API and Download GCam Port for Xiaomi Mi A1.

Instructions to Root Xiaomi Mi A1

  1. First, download the latest Magisk installer zip file.
  2. Power off your Xiaomi Mi A1 completely.
  3. Press and hold the Volume Up and Power button to enter TWRP recovery mode.
  4. Go to the ‘Mount’ menu in TWRP.
  5. Tap on the ‘Enable MTP’ button and connect your phone to the PC using the USB cable.
  6. Download the Magisk installer zip file and transfer it to your phone’s storage.
  7. Once transferred, disconnect the phone from the PC.
  8. Go back to the TWRP main screen and tap on the ‘Install’ button.
  9. Navigate to the storage and select the Magisk installer zip file (Magisk-v20.3.zip).
    Flashing Magisk in TWRP to Root Xiaomi Mi A1
  10. Finally, swipe the button to flash the file and root Xiaomi Mi A1 using Magisk.
  11. Press the ‘Reboot System’ button.

Once your Mi A1 boots into the OS, you shall see “Magisk Manager” in the app drawer. You can leverage it to hide root from certain apps or install modules to customize almost any aspect of the software. You can now also use root-enabled apps on your device, install mods like ViPER4Android and Dolby Atmos, and customize it to your needs.

If you have any trouble while performing the instructions to install TWRP and root Xiaomi Mi A1, then feel free to drop a comment.

TWRP source: 1, 2

Comments

  1. Connect your phone to the PC and transfer the downloaded file to the phone’s storage. — In which location we have to place the image file. Because when I go into TWRP recovery mode to install the image file I could not browse the dir

    1. You could place it anywhere. Are you going to ‘Advanced’ > ‘Install Recovery Ramdisk’? What folders do you see when the selector opens up?

  2. I can’t install any rom on my Xiaomi MI A1. Help me!

    Every Rom I install, sometimes via TWRP or MIFLASH. When I’m in the initial settings,
    the phone freezes and restarts. Only one rom entered the home screen of apps,
    but with little time it freezes and restarts. Before changing the battery, I had already installed the same rom,
    in this case, Pixel Experience 10 and installed it correctly.

    Now, after the exchange, this is happening in all rom. Some help? Appreciate!

    1. Hi Igor. I strongly suspect it’s the new battery that’s causing this issue.

  3. Hello Dhananjay, As soon as the TWRP booted , the screen of my device froze. I’m new at this all rooting and installing TWRP. The boot ends at asking Unmodified System Partition and makes me swipe to allow modifications. Unfortunately the swipe and the whole screen doesn’t work now. What to do? I downloaded the official one (TWRP).

    1. Hi Anand. Please reboot your phone back into Fastboot Mode and try the unofficial TWRP. The official TWRP is pretty much outdated and doesn’t work as expected, especially on newer Android versions.

  4. Sorry,
    i followed steps to install twrp permanently (i was on revengeos, android 9);
    after all steps, it was possibile only reboot into recovery!!!

    1. Hi d_borghi, may I know which version of the TWRP did you use? The official or unofficial one?

  5. ty for the guide and proper links.somhow the second day I installed a 3.18 kernel accidently,i got bricked.flashed stock 7 through fastboot!then do I need to upgrade to pie for installing twrp and customs based on pie?

    1. Hi Vishnu. You can install TWRP and root on Android Nougat too. Or you can first upgrade to Pie and then do it. It’s up to you.

  6. Bro, i converted my pubg into a system app on pixel experience rom and now my device is stuck on fastboot mode. Now I am installing the rom again. Can you help in finding the reason behind this fastboot loop issue???

    1. Hi Tejas. May I ask how you converted PubG into a system app? Which exact method did you use?

  7. when backing up there was a error Failed to mount ‘/vendor’ (Invalid argument)
    same error shown while installig magisk
    after updating partition done it shown on red Failed to mount ………..

    will it be any problem. Why there is no vendor info or vendor image in my MIA1 device

    Also tell me about Wipe Dalvik option

    1. Hi again, Anshuman. Were you using a custom ROM prior to flashing Magisk?

  8. So after downloading twrp-3.3.1-0-tissot.img , no need to download CosmicDan’s TWRP ?
    Both are same programme?
    What id treble support ?

    1. Hi Anshuman. CosmicDan’s TWRP is actually meant for Mi A1 with Treble support. Which is mostly applicable for custom ROMs.

      If you only want to install TWRP and root the phone on the stock ROM, then use the official TWRP (twrp-3.3.1-0-tissot.img).

    2. Hi Dhananjay.
      Can I install Official TWRP zip to install a custom rom on my mi a1? or do i have to install the CosmicDan’s TWRP?
      Please confirm me asap..!

  9. Hi..Dhananjay.
    I was succesfull with this methods on Mi A1 pie (November update), everything is work good. But, I have some litle question after rooting, did we have received update OTA for next time? FYI, I am in Indonesia.
    And the second question is, what the effect of we relock bootloader?
    Thanks.

    1. Hi Ricky. Taking official OTAs wouldn’t be possible with rooting and a custom recovery like TWRP installed. However, there is a working way to install OTAs on rooted devices. All the explanations and instructions for the same can be found in this post.

      Do not re-lock the bootloader at all if your phone has a modified software, your device will end up in a bootloop. It’s best to keep it unlocked.

    1. Hi Rajiv. I am glad it does. BTW, are you running Android Pie or Android 10 (via a custom ROM)?

    2. Bro, can i do this complete process for my mi a1 running on pie Oct security patch? Or do I need new twrp recovery files and all? Can u please confirm. I already rooted my phone with magisk. Now I want to install twrp recovery.

    3. Hi Teja. Yes, it will work. A fellow reader has recently confirmed that the steps and files work correctly even on the latest Pie November update.

    4. And one more query, can u also provide the instructions to install a custom recovery through TWRP. I want to install android 10 (Pixel experience rom) on my phone. Thank you.

      And your blog gives me a very clear idea what is what about this rooting and all… Thanks for that too..

    5. Hi again, Teja! Thank you so much for the kind words.

      Do you mean a custom recovery or a custom ROM?

    1. Hi Mustakim. Do you mean that the “fastboot oem unlock” command failed to unlock your Mi A1’s bootloader?

  10. Hello,

    I have an M1 A1 runing on Android 9, August 2019 update. I am trying to root it but while in TWRP recovery mode I am unable to install TWRP zip. Any advice?

  11. Hi … I have new mi A1 Oreo 8.0 version patch match 2018. I want root this phone, but There is many ways to do it. some people works and not. Which one i choose to root safely? I scare to brick this phone. Please help me.

    1. Hi. Rooting it could be done via two different methods, based on what exactly you want on the whole. Both the processes are spot-on and work perfectly, only if done right.

      So, let me know something. Which one of the following do you want?
      1) TWRP + Root: TWRP further allows you to flash kernels, custom ROMs, mods, etc.
      2) Just Root: The best way if you want to install updates over-the-air.

    2. I want twrp+root . So can i succes do it from this methods, using all Oreo files?

  12. Hi .. i need HELP!
    i really want to install twrp recovery, will i really be able to do it using the step above on the latest april patch pie mi a1?

    bc i’ve done everyways on the youtube that tell how to install the twrp recovery and it end up on “the systrm has been destroyed” when i want to boot into recovery using volume up + power button ☹️

    1. Hi. Download the new V3.3.0-2 TWRP image, installer zip, and Magisk 19.1 zip. Then follow the TWRP installation instructions with the new files that you downloaded. Right after you flash the installer zip, also flash the Magisk 19.1 zip. Once flashed, reboot your phone. The error should be gone now.

      Let me know how it goes.

  13. Hi…could you give one help? I flashed my A1 by miui 10 and I get bootloop,so I tried to restore my previous backup of android pie,but my A1 stucks at android one page,it can’t boot to system,I let and wait for minutes but it’s still like that without any changes…just loading at the android one page…I have done everything,such as flashing new stock rom by using mi flash or flashing in recovery mode…but it still stucks at android one page…give me solution,please…thanks before

    1. Hi Irfan. Have you tried booting your Mi A1 into stock recovery and performing a factory reset?

      Also, did you backup the EFS partition while taking the TWRP backup?

  14. Your instruction is really great among all. It is easy and clear. Thanks. Moreover,I want to say can I root mi a1 using platform tools. Fastboot patche boot april.

    1. Thanks a lot for the kind words. Do you mean that you want to root your Mi A1 using Magisk patched boot image method (Without TWRP)? Right?

  15. Hi, I followed your steps but after permanently installing the TWRP Installer it doesnt work. What I mean is, after trying to boot to TWRP Recovery again, I always get greeted with the “Fastboot” Recovery instead of TWRP Recovery. Can you please help me?

    1. Hi. Are you sure that you unlocked the phone’s bootloader before performing this procedure?

  16. Hi, I installed TWRP recovery and it works well, but after I flashed Magisk, I cannot see any application on the phone. (I tried several times). Can anyone help me?
    (sorry for my English, I’m French)

    1. Hi, which version of Magisk are you flashing? Also, is your Mi A1 running Pie?

    2. Hi Vaibhav, which version of Magisk did you use? Was it 18.1 or the latest 19.3?

  17. Hello,
    i did everything u said and still root checker says “not rooted”
    when i go in recovery mode and try to flash it says at the end sucessfuly flashed but then when i turn on my phone again nothing new

    1. Hi John. It seems like you missed something. Did you need to use the fastboot slot active command anytime during the process? Or did booting into TWRP worked in the first try?

  18. helpp issue with boot loop …oem unlocked tried to install pixel exp everything went fine …then idk why i was tryng to flash magisk then redwolf wont turn on tried to flash it went to boot loop…..then i used mi flash tool then no luck got the warning not detction and teling to visit mi site….now turned off the phone …i think the issue started coz of partition slots a b

    1. Hi Sreenath. Did you put your phone into Fastboot mode while connecting it to the PC (Mi Flash Tool)?

  19. Failed on mi A1 Jan 2019 update.
    It tells same with problems above, “the system has been destroyed”.

    1. Hi Hryd. Please boot into TWRP and flash Magisk v18.0. Please let me know if the message disappears then.

    2. You meant to flash The Magisk just after Flashing TWRP installer?
      Hope that would solve the problem…

    3. System destroyed happened….
      How to revert back to normal?
      Help me… I’m a noob

    4. Hi Srikrishna. Please download Magisk zip, boot into TWRP and flash it. See if the error still persists.

    5. after flashing Magisk it still persist. however when i boot normally and TWRP prompt to update new version. I went ahead and update and now I am able to boot into TWRP recovery using power + vol up. But I cant find Magisk in app drawer.

    6. Hi Ryan. That’s because when TWRP updates, it re-patches the “boot” partition and Magisk is lost. That’s because both TWRP (recovery) and Magisk are installed on the said partition. To overcome this, simply re-flash Magisk 18.1 using TWRP. Let me know how it goes.

    7. i reflash magisk v18 not knowing theres a new version, no luck there still missing Magisk.
      found Magisk manager online and install manually and launched. prompted to download the latest v18.1 and reflash….now Magisk manager shows all updated…thank you Dhananjay!

    8. Glad to know that! Enjoy your rooted Mi A1 now. Let me know if you have any other questions.

    9. i do face problem like ryan. i cannot find any magisk manager in app drawer. i did updated the twrp app when i booted up help me bro huhu. why it said that ‘failed to mount ‘system’ (device or resource busy) ‘ in red color. and also ‘unable to mount storage’ red color

    10. and also, i still can access twrp. but still there is no magisk manager in app drawer 🙁

  20. After flashing TWRP on android 9 when press vol up+power a got an error System is destroyed. pres powwer to reboot.

    Please help

    1. Hi, which files did you use exactly? Could you please list the filenames here?

    2. 1. twrp-3.2.3-1-tissot.img, from the ADB booted TWRP without problem.
      2. After booted up TWRP then install “TWRP-Installer-3.2.1-with-Tissot-Manager-2.5.zip”
      3. Install goes ok and after restart i got an error System is destroyed. pres power to reboot.

      I have a password when boot to Android. Is that password a possible problem?
      I have a Mi A1 with Android 9 and january security patch.

      Thank you.

    3. That’s odd. The password is the same as your lockscreen password. It is asked in order to decrypt the phone.

    4. Okay. I found some similar reports on the forums as well. For now, please restore your stock boot.img file from the Fastboot ROM to fix this.

      Once I have any updates, I will keep you posted.

    5. Hi Imtiaz, are you sure that the bootloader is unlocked? The message mostly appears when the system has been modified with a locked bootloader.

      Have you tried flashing Pire 10.0.4.0 fastboot image via Mi Flash tool?

    6. I got the same above problem..when i try to boot into twrp by Pressing volume up+power..it says system is destroyed
      I was even stuck while booting back to my system
      Please find a solution to this..i think the procedure is faulty somewhere for android pie
      I’m also on jan. Patch

    7. Hi Ankit. I am thinking the same now. Pie January Update for Mi A2/A2 Lite also has problems with TWRP. I believe the update brought some new changes with it (Not sure, but it seems like).

      I will keep a tab on the XDA forums and ping you back here when I find something. Thanks for your patience.

    8. Hello i think i have the same problem when i press power buttor + power up it says
      system destroyed
      then i press power button and phone goes back to normal android
      do you have any fix?
      i realy want to root my mi a1 my bootloader is unlocked

      thank you

    9. Hi John. Please reboot into TWRP and flash Magisk 18.1. The error should be gone then.

      Here’s what happens: The newer and more recent bootloader version for Xiaomi Mi A1 includes an extra security check, which I personally think is redundant. Even after an unlocked bootloader, the phone checks for stock recovery (Which it shouldn’t be doing in normal scenarios). If it finds a custom recovery, it throws the error. To fix this, you need to flash Magisk that will disable the security features.

    1. Yes, I am covering a guide on that as well. Just keep an eye on the homepage.

    1. Yes, it will work on Oreo as well. Just make sure to use the Oreo-specific TWRP build.

    1. Yes, Eric, it is required to unlock the bootloader first. Don’t worry, it will not wipe the storage/data.

    2. it wiped my data with normal oem unlock
      To avoid wiping data u have to hold the volume down button after the command.

    3. Hi Aswin. Xiaomi has been confusing since beginning with Android One devices. Before the Mi A1 was ever introduced, every device when bootloader unlocked would be completely wiped.

      However, when the phone was released and users told that they were able to unlock the bootloader of the Mi A1 and it didn’t wipe the data at all, I was astounded. Couldn’t really believe it until I did it on my own.

      It seems like the bootloader has been updated in the recent firmware updates, which now triggers a wipe when we issue the ‘fastboot oem unlock’ command.

      I will look forward to some more confirmations and will then update the article too.

      Thanks for taking the time to comment.

    1. Hi, that’s because the storage is encrypted. In order to decrypt it and to be able to access the storage/files, you will need to enter the password.

    2. You will need the password/PIN of the lockscreen (That you have set) to decrypt the /data partition in TWRP.

    1. Hi Jose, yes, this will work on Android 8.1 Oreo as well. Just make sure to use the Oreo-specific TWRP and Magisk v17.1.

    1. Hi Bramadrak, I am sorry but there’s no video tutorial from us at the moment. Although, I can assure that this guide works perfectly fine.

  21. how to update july ota package. i followed your guide and it worked perfectly. but i can’t install the ota update. please help

  22. I followed your guide and rooted my mi a1 perfectly. The problem is i can’t install July OTA update.

    I tried to update July pack by following these steps but failed.

    Couldn’t install Magisk Manager after OTA update “Install to Second Slot” option is missing. So I chose not to install Magisk Manager.

    After reboot, the phone went to TWRP screen. I flashed magisk. After another reboot, My M1 showed this message “couldn’t update Installation problem”. Fortunately, the phone works fine so far.

    What do i have to do to update and root my phone properly. Thanks for the answers.

    1. Upgrading your phone using OTA and still maintaining root is more of a hassle in my opinion. I do plan on covering a tutorial on that as well.

      What I’d suggest is, you can simply use TWRP flashable ZIP or Fastboot image to update your phone (We always have a post for that, you can find the July 9.6.4.0 update on the homepage itself). In both the cases, the data will not be wiped, if you follow everything correctly.

      As for root, all you have to do is simply flash the latest Magisk ZIP using TWRP, that’s all.

  23. In my Mi A1, device is not booting after step no.10.
    i tried fastboot set_active a & B both but still no response.
    cmd shows again & again…..

    plz help

    1. Hi Anuj, can you please share a screenshot with me of the CMD window? When you type in “fastboot devices”, what does the CMD show in the result?

  24. Everything was fine but when I install Dolby atmos it gives error “partition file not found” ultimately leading me in unsuccessful of installation…What should I do to fixed that error? Should the run the command again? Plz help

  25. I am on January security patch 8.0 .., developer option is showing ” bootloader is already unlocked” but when I go to fastboot boot recovery.img and then try to install the files which I kept previously in internal storage it doesn’t show up. I mean I don’t see internal SD card is mounted. Tried with external but end up in error. What should I do?

    1. That is because TWRP is not able to decrypt the internal storage on Oreo. I have updated the links to the latest TWRP version 3.2.1-1. Kindly try that and report back with the results.

    2. I had similar problems. Even with the latest version the decryption is not possible.

    3. Hi Avish and AJ, I have updated the download links with TWRP recovery and installer ZIP for Android Oreo. Please give a try with the new files.

    4. hI there,

      thanks for the tutorial it has been very helpfull but the same thing as mentioned above keeps occuring even after you updated the link.

      any thoughts on this?

    5. Hi Dmitri. Even while using the Oreo-based TWRP, you will still need to ensure that you first Format Data in TWRP recovery to make sure that the encryption is removed.

  26. Hi, can I install TWRP and Magisk on Nougat December update? I tried once on Official Oreo. But as soon as I installed Magisk, my device got stuck in boot loop and I had to send the device to the service centre. And now I am back to Nougat December patch level. I want to know if this method will work on Nougat december patch level or will it again stuck in boot loop?

    1. Hello zahi, did you install Oreo using the official OTA update or by restoring through TWRP?

    1. Hello, did you install Oreo using the official OTA update or by restoring through TWRP?

    1. Theoretically, it should. There’s are not major system/kernel related changes in the latest update except for the security patches. I have updated the guide with Magisk 14.5. It should work just fine.

    2. Done! Everything went flawlessly, thanks!! I installed both TWRP and Magisk.

      On the B partition it wants to install the November update again but fails. I switched back to the A partition where the update has already been installed. Do you know if future updates will also fail or shouldn’t that be a problem?

    3. That’s pretty much normal. So don’t worry. The next time, you can simply install the update manually too.

    1. Hello, which Magisk version did you install? That’s pretty odd. I have seen several users reporting success at XDA.

    2. Hello again, it seems like the official TWRP page is not reflecting the latest build and changes. I have updated the TWRP image link, kindly boot that one and follow the complete process again. Let me know it works.

    1. Yes, you can easily install Xposed on the device. Several users over at XDA itself have got it to work.

      What you need to do is, open the Magisk Manager app and then open the ‘Download’ section. Search for ‘Systemless Xposed’ and install and activate the module.

      You will easily be able to use Xposed on your device then. Good luck.

Leave a Reply

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