give me step by step instructions on how to do this. Let me know what version of android I will need to ijstall on the virtual device and then instructions for everything
root the AVD, flash Google Play, install Magisk + PlayIntegrityFix, spoof a working keybox)root the AVD, flash Google Play, install Magisk + PlayIntegrityFix, spoof a working keybox)
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Of course. Here is a comprehensive, step-by-step guide to achieving a rooted Android Virtual Device (AVD) with Google Play, Magisk, and a passing Play Integrity check.
Disclaimer & Important Preamble
This guide is intended for educational, development, and security research purposes only. Modifying a system image and bypassing security mechanisms like Google Play Integrity can be complex. This process can be unstable, and the methods may become outdated as Google updates its security measures.
Follow the steps precisely. A small mistake can require you to delete the AVD and start over.
This will not work on all Android versions. Newer versions (12+) have increased security that makes this significantly harder.
The goal is to create a sandboxed development environment, not to perform malicious activities or pirate applications.
Recommended Android Version
For the highest chance of success and stability, we will use:
Android Version:Android 11 (R)
API Level:API 30
System Image:Google APIs Intel x86_64 Atom System Image
This version is modern enough for most app testing but predates some of the more difficult security hurdles introduced in Android 12 and later.
Part 0: Prerequisites - What You Need
Android Studio: You must have Android Studio installed and updated. This is the official IDE for Android development and includes the SDK Manager and AVD Manager. Download it from the official Android Developer website.
ADB (Android Debug Bridge): This command-line tool is included with Android Studio. Make sure its location is added to your system's PATH for easy access from your terminal or command prompt.
Open GApps: We need to flash the Google Play Store. Go to the Open GApps website. Select the following options:
Platform:x86_64 (Important for AVDs)
Android:11.0
Variant:pico (This is the smallest package and all we need)
Click the download button. You will get a .zip file.
GApps Sideloading Script: A helper script makes installing GApps on an AVD much easier. We will use one from GitHub. Open your terminal/Git Bash and run:
Navigate to the Download folder and select the PlayIntegrityFix...zip file.
Once it's finished flashing, tap the Reboot button at the bottom.
Spoof the Keybox / Device Fingerprint:
Relaunch the AVD with -writable-system.
The PlayIntegrityFix module comes with a tool to help you pick a working device profile. We will run it via ADB.
Open adb shell:
bash
adb shell
Once you are in the shell, request superuser (root) access and run the properties script:
bash
su -c props
You will see a menu.
Press 1 to "Edit device fingerprint".
You will see a list of certified device fingerprints. Pick one that is a well-known, recent device (e.g., a Pixel model). Type its number and press Enter.
The script will apply the fingerprint.
Reboot the AVD when prompted.
Clear Google Services Data (Crucial Step):
After the final reboot, go to Settings -> Apps & notifications -> See all apps.
Find Google Play Services. Go to Storage & cache -> Manage space -> CLEAR ALL DATA.
Go back to the app list and find Google Play Store. Go to Storage & cache -> CLEAR STORAGE.
You now have a fully rooted AVD with a working Google Play Store that passes basic integrity checks, ready for your development and testing needs.