Sign up & start scraping for FREE — right now.

Bypass All Limits: How to Root Your Android Emulator for Total Control in 2025

July 28, 202510 min read
Photo of Mykyta LeshchenkoMykyta Leshchenko
Android rooting concept image showing a person with a smartphone, representing advanced system access

Key Takeaways

Root access gives full control over Android emulator devices, ideal for developers.

You’ll need Android Studio, ADB, and basic command-line tools to get started.

Magisk is used to gain systemless root access on your emulator.

The guide walks through creating an AVD with API 29 for stability.

Rooting is achieved using the open-source rootAVD script with minimal risk.

Introduction

Ever wanted to fiddle with your Android emulator phone a bit more in-depth, but were afraid that something would break? No worries, this guide will teach you how to get full root access over your emulated Android phone.

What is root access?

Basically, root access is the highest level of access. Acquiring root gives you full control over what you can run, customize, and configure on your phone. That includes (full system access, running privileged apps, visual customization, file system access and much more). For instance, when there is a need to install some shady application which is not from your average Play Store, your phone will forbid that due to security reasons, but with root access, you can bypass these security checks and install whatever you want, no questions asked.

Usually, root access is not needed for an ordinary phone user and is mostly used by developers and advanced users for debugging purposes. Having said that, if you are reading this, I would imagine that you are no ordinary user and you have your reasons for rooting your phone. So let's dive into rooting.

Prerequisites

Before we begin, we will need to install a couple of things:

  • Git for cloning repos
  • Android Studio installed with the latest Android SDK, including SDK Platform Tools (adb)
  • Basic knowledge of Android Debug Bridge (ADB) and command-line tools
  • Command-Line Setup:
    • Add Android SDK tools (adb, emulator) to your PATH on macOS/Linux
    • For macOS (Zsh/Bash): Update ~/.zshrc or ~/.bash_profile, then run source ~/.zshrc or source ~/.bash_profile
    • Verify setup with adb --version and emulator -list-avds in a new terminal
bash
export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator"

1. Create a new device in Android Studio

First and foremost, we need to create a device which we are going to root. Click on the more actions menu and then on Virtual Device Manager

Android Studio interface with an arrow pointing to the 'Device Manager' button in the toolbar, showing where to access Virtual Device Manager

This will open a new window where you can create a new device. Click on the + sign

Virtual Device Manager window with an arrow pointing to the '+' button, used to create a new virtual device

You will see a list of available devices. What we are looking for here is a device which can run API v29. The reason why we are choosing specifically this version is because versions 30 and above are a bit unstable and might not work as expected with this root access approach. Having said that, you can always try :), but in this guide, we will proceed with API v29. Other than that, it doesn't really matter what type of device (tablet, phone, TV) we are choosing. As long as it supports API v29, we are good to go. Click on the device and then click on the Create button.

Select Hardware dialog showing a list of Android device templates, with phone models highlighted that can support API level 29

This will open a new window where you can configure your new device Click on the API dropdown and choose System Image with API v29. Leave all other settings as is and click on the Finish button.

System Image selection dialog showing API level 29 (Android 10) being selected, with Google Play Store services option highlighted

After that, a new system image will be installed to your machine. After installation, you will see a new device in the list of available devices.

Virtual Device Manager showing the newly created Android emulator device with API level 29 in the list of available devices

Now that we have a new device, we can click on the run button and it will start the emulator.

Android emulator booting up, showing the initial Android loading screen as the virtual device starts

With this device, we can do whatever we would do with our usual phone, like installing apps, playing games, etc. Our next step is to actually root it.

2. Rooting our device

First, we need to connect to the shell of this device through Android Debug Bridge (adb).

ADB is a versatile command-line tool provided by the Android SDK that enables communication between a computer and an Android device or emulator. It acts as a bridge for developers and power users to perform tasks like debugging apps, emulator control, and so on. ADB is included with the Android SDK, which is typically installed via Android Studio. So it should already be on our machine.

To check that, we need to run the following command in a new terminal:

bash
adb devices

If everything up to this point was configured correctly, it is going to output the following:

bash

 List of devices attached
   emulator-5554	device

That means our emulator is running and adb is installed. In the list, we can clearly see our current emulated device running.

The next step is to connect to the shell of the device. It allows us to interact with the device through commands. To do that, we need to run a command:

bash
adb shell
Terminal window showing successful connection to the Android emulator via ADB shell, displaying the internal Android file system path

As we can see, now it is possible to interact with the emulated device through the command line. For instance, we can type ls to list all files in the root directory. But as we can see, all of the files are currently with Permission denied status. That is because we still don't have root access.

We can try to enable the root access by running the following command:

bash
su

Which gives us the following output:

bash
Permission denied

To get necessary permissions, we will need to install a tool called Magisk on our emulated device.

Magisk is an open-source tool for rooting Android devices and emulators, offering a systemless approach to gain root access. Unlike traditional rooting methods that modify the system partition, Magisk modifies the boot image, allowing root access without altering core system files. This makes it ideal for maintaining compatibility with apps that detect root (e.g., banking apps) and enabling advanced customizations.

To install Magisk on our emulated device, we need to clone the rootAVD repo:

bash
git clone https://gitlab.com/newbit/rootAVD.git

rootAVD is a script designed to root Android Virtual Devices (AVDs) running on the QEMU emulator within Android Studio, using Magisk to provide root access. It modifies the AVD's ramdisk image to integrate Magisk, enabling system-level access for advanced tasks like app testing, reverse engineering, and security research.

After you have cloned the repo, inside you will find a script called rootAVD.sh. We need to run this script. If you are on Windows, you need to run rootAVD.bat respectively.

Terminal window showing the cloned rootAVD repository directory contents, with rootAVD.sh script highlighted

To run the script, simply type:

bash
./rootAVD.sh

You will see the following output:

Terminal showing rootAVD.sh script output with available command options and usage instructions for rooting Android Virtual Devices

As you can see, we have all of the commands which are supported by rootAVD. We need a specific one:

bash
./rootAVD.sh system-images/android-29/google_apis_playstore/arm64-v8a/ramdisk.img

This command will install Magisk on our emulated device through which we will be able to gain root access to it. It is important to choose your version of the emulator. In my case, I am using API v29.

If you have your Android device running, it will reboot the device. If your device is not rebooting for some reason after this command execution, just reboot it yourself.

If you did everything correctly, upon reboot you will see a new app installed on your Android device:

Android emulator home screen showing the newly installed Magisk app icon among other system applicationsMagisk app opened on the Android emulator, showing the main interface with Magisk version and root status information

Now we need to connect back to the shell of the device:

bash
adb shell

And try to enable root access again:

bash
su

If everything went well, you will see the following popup on your device screen:

Magisk superuser request dialog asking for root permission, with 'Grant' and 'Deny' buttons visible for the shell command
bash
whoami

And we should see that we are root.

Terminal showing successful root access in the Android emulator, with the prompt changed to # and 'whoami' command confirming root user status

Conclusion

In this guide, we have learned how to root your Android emulator phone. Thanks for reading! Check out our other guides below.

Photo of Mykyta Leshchenko

Mykyta Leshchenko

Head Of Content At Red Rock Tech