1. git clone https://github.com/newbit1/rootAVD.git
  2. cd rootAVD
  3. ./rootAVD.bat ListAllAVDs or ./rootAVD.sh ListAllAVDs if its linux. See the android device you want to root
  4. Run the command rootAVD.bat system-images\<yourandroid>\google_apis_playstore\x86_64\ramdisk.img
  5. The AVD will shut down, restart it in android device manager
  6. Run Magisk. If it requires extra setup and restart then allow it
  7. adb shell, and then type su, go to magisk app and grant permission. You are now root