On non-MIUI devices, we can use Vanced Manager to seamlessly install YouTube Vanced and its accompanying microG.
On MIUI, it's a bit more cumbersome -- we need to disable MIUI optimizations before we can install YouTube Vanced.
There is actually another way if you have a laptop with adb.
- Download and install Vanced Manager.
- Open Vanced Manager, install microG and Vanced. This will fail for both apps, just choose "Close" each time.
- Open a file manager, and go to /sdcard/Android/data/com.vanced.manager/files
- There is a microg folder, install the apk file inside this folder.
- There is a vanced folder, copy all the apk files inside this folder to your laptop, for example into ~/vanced
- Now you can uninstall Vanced Manager if you want.
- On your device, sign in to your Mi account.
- Enable Developer options
- Enable USB debugging
- Enable Install via USB
- On your laptop, navigate to the folder ~/vanced and execute this command: adb install-multiple *.apk