As we step into 2025, my curiosity project involves delving deep into the Android operating system. One of the coolest ways to understand the nitty-gritty of Android internals is by rooting an emulator. A course I started recently on malware detection on Android had a wonderful and straightforward guide on this. My hope with this article is to jot down my notes for posterity, as well as show you the reader how to root an AVD, which forms the basis of any further forensic investigation for malware samples. Rooting provides you superuser access, allowing you to explore beneath the usual user interface. It’s a gateway to customizing everything from the boot animation to the system UI. Today, I’ll guide you through the process of rooting an Android emulator.

Step 1: Set Up Your Emulator
First things first, launch Android Studio and create an emulator AVD (Android Virtual Device). When doing this, it’s crucial to note whether your emulator uses a Google Play image or a non-Google Play image. This detail is important for the rooting process later on.
Step 2: Launch Your AVD
Start your AVD with special parameters to make the system partition writable:
emulator -avd name_of_avd_from_android_studio -writable-system -no-snapshot-load
This command is essential as it prepares your emulator for the rooting scripts, ensuring that changes can be applied and persisted.
Step 3: Clone RootAVD
Next, we need the RootAVD toolkit, which automates the rooting process:
git clone https://gitlab.com/newbit/rootAVD.git/
cd rootAVD
RootAVD is a fantastic tool that applies the correct rooting patches based on the type of emulator image you are using.
Step 4: Identify the Correct AVD Image
Before applying any patches, you need to list the available AVD images that can be rooted:
./rootAVD.sh ListAllAVDs | grep 34
Replace 34 with your Android API version. Make sure you correctly identify and separate between Google Play and non-Google Play images. Also, ensure your emulator is connected to the internet, or the patch process might fail.
Step 5: Apply the Rooting Patch
Once you’ve located the right command for your specific AVD variant, execute it. The script will guide you through the process, and your emulator will shut down afterwards. If prompted to save the state, choose “No”.
Step 6: Restart and Root
After the emulator has shut down:
emulator -avd name_of_avd_from_android_studio -writable-system -no-snapshot-load
When it restarts, you’ll notice that Magisk, a popular rooting solution, is installed. Open Magisk and first update the app. Once updated, reopen it and select “Install” followed by “Direct install (recommended)” to root the device.
Step 7: Confirm Root Access
To ensure your device is rooted:
adb shell
su
If you see a popup requesting root permissions for the shell, congratulations, you’ve successfully rooted your emulator!

Wrapping Up
Rooting an Android emulator is more than just a technical exercise; it’s a deep dive into understanding what makes Android tick. It allows enthusiasts and developers alike to test applications, experiment with different settings, and gain deeper insights into Android’s capabilities and limitations. Whether you’re developing new apps or just curious about Android, rooting an emulator can be a great project to expand your skills and knowledge. Happy experimenting!!