[Xiaomi Mi A2 Lite ROMs, Kernels, Recoveries, & Oth] viking777:
Time to 'fess up'

I was one of the many contributors on here that complained that the twrp recovery mentioned in OP was not at all usable - I was wrong.

I successfully installed twrp today and found that the problem was not the twrp recovery, and not me either, but actually a fault with my pc.

To recap, this is what the OP procedure states:

I had no problems with points 1 - 4, but immense problems thereafter. Point 5 was impossible. As soon as the phone rebooted into the twrp image, all access to adb or fastboot was lost so pushing anything to anywhere was a non-starter. Also pre-loading the twrp-installer on the sdcard was also useless as it was not seen by the booted twrp image.

I initially just gave up and complained, but today I started to investigate the adb issue further and found the problem.

At this point I must point out that I am a Linux user only and have no access to Windows, consequently I can only describe the problem and solution in relation to Linux.

So in your linux box, start with the phone unplugged and run the command

lsusb

and leave the terminal window open. Plug the phone in, open another terminal window, and run the same command again. Compare the two. The extra line in the second terminal will be your phone id. In my case the phone was identified only by the words 'Google Inc' and the id used a generic google id namely 18d1:4ee7 - make a note of this. As it is just a generic id yours will probably be the same.

Now on your pc go to /etc/udev/rules.d/51-android.rules and open this in a root text editor. It will look like this (if it exists at all):

SUBSYSTEM=="usb", ATTR{idVendor}=="d00d", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb",ATTR{idVendor}=="[d00d]",ATTR{idProduct}=="[6866]",SYMLINK+="android_adb"
SUBSYSTEM=="usb",ATTR{idVendor}=="[d00d]",ATTR{idProduct}=="[6866]",SYMLINK+="android_fastboot"

The actual numbers that it has in your copy are irrelevant, these are just ones that I had. Change the rule so that it looks like this:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb",ATTR{idVendor}=="[18d1]",ATTR{idProduct}=="[4ee7]",SYMLINK+="android_adb"
SUBSYSTEM=="usb",ATTR{idVendor}=="[18d1]",ATTR{idProduct}=="[4ee7]",SYMLINK+="android_fastboot"

Notice that whatever was in the {idVendor} and {idProduct} sections have been changed to reflect the values obtained from the 'lsusb' command. If the file doesn't exist in your system then create it (just copy mine above but substitute your id values if they are different). You will need to create this file with root privileges so it should be owned by root and have 0644 permissions.

Save this file and reboot your pc, then check to see if the correct values are still in place (they should be).

Now you are in a position to start the OP procedure. In my case point 5 now worked, as did the rest of the procedure.

If it doesn't work for you, then there are a few other things you can check. When you first plug in the phone, run

adb devices

- if you get the word 'device' followed by a number you should be OK to go, if you get the word 'unauthorised' or nothing at all then something is still wrong.

Some people have reported that adb will not work if the phone is set to 'charging' mode when plugged in (the default) and that changing this to 'ptp' or 'file transfer' will fix this, so it is worth enabling one or the other (start with ptp). When you do this for the first time you should be asked to allow usb debugging from your pc - you must tap to allow this (if the allow message doesn't pop up it probably means you have already allowed it earlier and ticked the 'remember' box). Lastly is your username in the 'plugdev' group? To check this open a terminal and type the command

id

- you will see a list of all the groups that your username is a member of. If 'plugdev' is not in the list then you will have to add it as follows:

sudo usermod -a -G plugdev YOURUSERNAME

On my distro there is an adbusers group that I added myself to as well - this may not exist elsewhere.

I hope there is something in there that will help out anyway - it does work, it is just a bit of a battle to get there.