Getting Started
rootAVD offers a set of handy scripts with Magisk to root an emulator within no time.
To download, follow rootAVD repo OR clone using below command in Terminal (Mac) or Command Prompt (Windows)
~ % git clone https://github.com/newbit1/rootAVD.git
Alternatively, same repo is hosted on GitLab -> rootAVD. No change is steps to root device.
Once cloned, change dir using below cmd
~ % cd rootAVD
Next up, run ./rootAVD.sh
to start rootAVD
agent:
rootAVD % ./rootAVD.sh
At this point, rootAVD agent is active. Now, before running another set of commands, ensure Emulator is running and not rooted.
I’m using Pixel 6a, API 29 for this demo. To verify root status, run adb shell
in Android Studio terminal:
% adb shell
generic_x86:/ $
Now, run su
for super user access:
generic_x86:/ $ su
/system/bin/sh: su: inaccessible or not found
Since, su is not accessible we can confirm device is NOT rooted.
Back to the rootAVD agent in terminal, run ./rootAVD.sh ListAllAVDs
to list all the available emulators.
Select and copy cmd having ramdisk.img
of running emulator/AVD
Now, run the cmd to start patching emulator with root privilege
rootAVD % ./rootAVD.sh system-images/android-29/google_apis_playstore/x86/ramdisk.img
At a point, it will prompt to select Magisk channel — Stable, Canary or Alpha. Wait to auto proceed with Stable version of the Magisk.
Once the patching finishes, Emulator will shut down automatically.
Yayyy!! Emulator is now patched with ROOT access 🎉
Boot the same emulator to verify Magisk App & ROOT status in terminal of Android Studio