• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[SCRIPT] rootAVD - root your Android Studio Virtual Device emulator with Magisk [Android 12][Linux][Darwin/MacOS][WIN][Google Play Store APIs]

Search This thread

newbit

Senior Member
Nov 16, 2008
166
68
We tried your script. It doesn't work.

We need privileged root to copy file in data/data/com.android.shell/magisk

We can't unlock bootloader since it's an AVD (OEM button doesn't appear anywhere which is normal).

If we try your script on an AVD without playstore we have more privilege which allow us to copy these files. But there's another error when you launch busybox. At this point the script stop.
Thanks for using my script.
Please check out the first page to fill out the question with all details you can provide.
Cheers
Newbit
 

notadog

New member
Sep 22, 2021
3
1
Hi,

I tried running the script, but I kept getting this:

.\rootAVD.bat InstallApps
[*] Set Directorys
[-] Test if ADB SHELL is working
[!] ADB binary not found in %LOCALAPPDATA%\""

Win 10
Latest version of Android Studio
AVD Pixel 4 API 30 Android 11
 

newbit

Senior Member
Nov 16, 2008
166
68
Hi,

I tried running the script, but I kept getting this:

.\rootAVD.bat InstallApps
[*] Set Directorys
[-] Test if ADB SHELL is working
[!] ADB binary not found in %LOCALAPPDATA%\""

Win 10
Latest version of Android Studio
AVD Pixel 4 API 30 Android 11
Hi,

did you met the requirements for the script to run?
Can actually connect to the AVD via adb?
 

notadog

New member
Sep 22, 2021
3
1
Hi,

did you met the requirements for the script to run?
Can actually connect to the AVD via adb?
I was following along the YouTube video you had posted so I did not realize there were other steps you might have done that were still active. After a bit I was able to use adb shell, but I'm not sure of what to do at that point before going back to the other steps you have.

adb shell
generic_x86_arm:/ $

Thanks!
 

newbit

Senior Member
Nov 16, 2008
166
68
I was following along the YouTube video you had posted so I did not realize there were other steps you might have done that were still active. After a bit I was able to use adb shell, but I'm not sure of what to do at that point before going back to the other steps you have.

adb shell
generic_x86_arm:/ $

Thanks!
Oh wow, there is a video?
Never posted anything like that.
Can you send me the link please?

Check the readme and Just run the script, it has a huge help screen/menu that can give you even some example commands.
 

newbit

Senior Member
Nov 16, 2008
166
68
Thanks for the Video. I've added it to the first page. Looks good, even though it is not entirely accurate.
It covers the basics to get started. I would have done the video completely different, like no video at all.
I assume, that If you are planing to write an application for Android, in an Emulator for Android, downloading from Github and executing a script and reading its help menu is part of your repertoire. Also, I assume
that you read at least the very first page of this thread. I think there is almost everything already covered.
And if not, try to use the search in thread function, comes in very handy sometimes.

Regarding your issues.
The InstallApps argument is actually not needed. I guess because it is shown in the video first, people
assume it must be done first. But no, just run the script with the path to your ramdisk.img. Once this
process of rooting is done, the script calls the InstallApps routine itself.

When is it then needed?
For example, if the apps I need for the AVD becoming more and more, I just put them in the
Apps folder, and run the script with the InstallApps argument. So I don't have to install every app
single-handed. But again, this is all written down in the readme.md and in the scripts help menu.

Cheers
NewBit
 

meza000

New member
Oct 7, 2021
2
0
Hello Fellows,

here is a little script, rootAVD, I wrote to root Android Studio Virtual Devices with Magisk.
It is actually just a modified boot_patch.sh from @topjohnwu, which didn't work
for Android 11 (R), so I tried the script from @shakalaca MagiskOnEmulator.
Which didn't work for Android 11 (R) either, so I used his decompression routine to
modify my rootAVD script and now it works with Android 11 (R), Android 10 (Q)
and Android 7 (Nougat) with all the Google Play Store API Versions.
Successfully tested with Stock Kernels on Linux, MacOS and Windows.
All credits go to both of them.

I hope this might come in handy.

Cheers
NewBit

[Update 03.03.2021]
Updated to Magisk App v22.0 and Android 12 (S) Support

[Update 25.03.2021]
Added a Menu to choose the Magisk version to support Android 12 (S) rev 2.

[Update 29.03.2021]
Added Download Manager Function for bad TLS record
Please check out the README.md for "up to date" information.

Requesting for Help!

Please provide the following information If you are asking for support:
  • Host System
  • Android Studio Version
  • AVD Version
  • Magisk Version
  • Terminal input & output
Example Templates:
Host System:
sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
Android Studio Version: 4.1.3
AVD Version: Google APIs Intel x86 Atom_64 System Image (revision: 2)
Magisk Version: Stable 22.1
Terminal input & output:
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 153.2 MB/s (6720493 bytes in 0.042s)
[*] Set Directorys
[*] create Backup File
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 286.9 MB/s (2507370 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 82.8 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[-] Multiple cpio archives detected
[*] Unpacking ramdisk ..
[-] Dumping from 0 to 1603441 ..
Detected format: [lz4_legacy]
[-] Dumping from 1603441 to 2507370 ..
Detected format: [lz4_legacy]
[*] Repacking ramdisk ..
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=0
[-] Stock boot image detected
[-] Patching ramdisk
[!] PATCHFSTAB=false
[!] Skipping fstab.ranchu patch with /dev/block/sda
[?] If you want fstab.ranchu patched, set PATCHFSTAB=true
[!] patching the ramdisk with Magisk Init
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[-] After the ramdisk.img file is patched and compressed,
[*] pull it back in the Magisk DIR
[*] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 209.3 MB/s (2918094 bytes in 0.013s)
[-] pull Magisk.apk to Apps/
[*] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 236.2 MB/s (6720493 bytes in 0.027s)
[-] pull Magisk.zip to Apps/
[*] adb: error: failed to stat remote object '/data/data/com.android.shell/Magisk/Magisk.zip': No such file or directory
[-] Clean up the ADB working space
[*] Move and rename the patched ramdisk.img to the original AVD DIR
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
Performing Streamed Install
Success
[-] Shut-Down & Reboot the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu and shakalaca
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 50.7 MB/s (6720493 bytes in 0.126s)
[*] Set Directorys
[-] Backup exists already
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 339.1 MB/s (2918094 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 104.1 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [lz4_legacy]
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=1
[-] Magisk patched boot image detected
[-] Constructing environment - PAY ATTENTION to AVDs Screen
[!] we are root

Also, before you ask, please answer your self the following questions:
  • Did I read AND understood the README.md ?
  • Is my question as detailed and simple as possible couched ?
Also, please include my Username in your Salutation to make sure I will get notice of it.
I love to help, but asking all the time, where to pick you up, just increases the time period to get
your issues fixed.

Download the latest Version:
Direct: https://github.com/newbit1/rootAVD/archive/refs/heads/master.zip
Git: git clone https://github.com/newbit1/rootAVD.git

My thanks to Android AppSec for his wonderful little video about this script.
Android Studio Emulator (AVD) Rooting with Magisk using rootAVD
hi im error install magisk
[*] Set Directorys
[-] Test if ADB SHELL is working
else was unexpected at this time.
help me
 

newbit

Senior Member
Nov 16, 2008
166
68
hi im error install magisk
[*] Set Directorys
[-] Test if ADB SHELL is working
else was unexpected at this time.
help me
Hi, could you please provide more detailed background informations like I described:

Requesting for Help!

Please provide the following information If you are asking for support:
  • Host System
  • Android Studio Version
  • AVD Version
  • Magisk Version
  • Terminal input & output
Example Templates:
Host System:
sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
Android Studio Version: 4.1.3
AVD Version: Google APIs Intel x86 Atom_64 System Image (revision: 2)
Magisk Version: Stable 22.1
Terminal input & output:
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 153.2 MB/s (6720493 bytes in 0.042s)
[*] Set Directorys
[*] create Backup File
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 286.9 MB/s (2507370 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 82.8 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[-] Multiple cpio archives detected
[*] Unpacking ramdisk ..
[-] Dumping from 0 to 1603441 ..
Detected format: [lz4_legacy]
[-] Dumping from 1603441 to 2507370 ..
Detected format: [lz4_legacy]
[*] Repacking ramdisk ..
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=0
[-] Stock boot image detected
[-] Patching ramdisk
[!] PATCHFSTAB=false
[!] Skipping fstab.ranchu patch with /dev/block/sda
[?] If you want fstab.ranchu patched, set PATCHFSTAB=true
[!] patching the ramdisk with Magisk Init
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[-] After the ramdisk.img file is patched and compressed,
[*] pull it back in the Magisk DIR
[*] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 209.3 MB/s (2918094 bytes in 0.013s)
[-] pull Magisk.apk to Apps/
[*] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 236.2 MB/s (6720493 bytes in 0.027s)
[-] pull Magisk.zip to Apps/
[*] adb: error: failed to stat remote object '/data/data/com.android.shell/Magisk/Magisk.zip': No such file or directory
[-] Clean up the ADB working space
[*] Move and rename the patched ramdisk.img to the original AVD DIR
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
Performing Streamed Install
Success
[-] Shut-Down & Reboot the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu and shakalaca
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 50.7 MB/s (6720493 bytes in 0.126s)
[*] Set Directorys
[-] Backup exists already
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 339.1 MB/s (2918094 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 104.1 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [lz4_legacy]
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=1
[-] Magisk patched boot image detected
[-] Constructing environment - PAY ATTENTION to AVDs Screen
[!] we are root

Also, before you ask, please answer your self the following questions:
  • Did I read AND understood the README.md ?
  • Is my question as detailed and simple as possible couched ?
 

meza000

New member
Oct 7, 2021
2
0
Hi, could you please provide more detailed background informations like I described:

Requesting for Help!

Please provide the following information If you are asking for support:
  • Host System
  • Android Studio Version
  • AVD Version
  • Magisk Version
  • Terminal input & output
Example Templates:
Host System:
sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
Android Studio Version: 4.1.3
AVD Version: Google APIs Intel x86 Atom_64 System Image (revision: 2)
Magisk Version: Stable 22.1
Terminal input & output:
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 153.2 MB/s (6720493 bytes in 0.042s)
[*] Set Directorys
[*] create Backup File
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 286.9 MB/s (2507370 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 82.8 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[-] Multiple cpio archives detected
[*] Unpacking ramdisk ..
[-] Dumping from 0 to 1603441 ..
Detected format: [lz4_legacy]
[-] Dumping from 1603441 to 2507370 ..
Detected format: [lz4_legacy]
[*] Repacking ramdisk ..
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=0
[-] Stock boot image detected
[-] Patching ramdisk
[!] PATCHFSTAB=false
[!] Skipping fstab.ranchu patch with /dev/block/sda
[?] If you want fstab.ranchu patched, set PATCHFSTAB=true
[!] patching the ramdisk with Magisk Init
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[-] After the ramdisk.img file is patched and compressed,
[*] pull it back in the Magisk DIR
[*] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 209.3 MB/s (2918094 bytes in 0.013s)
[-] pull Magisk.apk to Apps/
[*] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 236.2 MB/s (6720493 bytes in 0.027s)
[-] pull Magisk.zip to Apps/
[*] adb: error: failed to stat remote object '/data/data/com.android.shell/Magisk/Magisk.zip': No such file or directory
[-] Clean up the ADB working space
[*] Move and rename the patched ramdisk.img to the original AVD DIR
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
Performing Streamed Install
Success
[-] Shut-Down & Reboot the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu and shakalaca
Code:
./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[-] Magisk installer Zip exists already
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Copy Magisk installer Zip
[*] ./Magisk.zip: 1 file pushed, 0 skipped. 50.7 MB/s (6720493 bytes in 0.126s)
[*] Set Directorys
[-] Backup exists already
[-] Copy the original AVD ramdisk.img into Magisk DIR
[*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 339.1 MB/s (2918094 bytes in 0.008s)
[-] Copy rootAVD Script into Magisk DIR
[*] rootAVD.sh: 1 file pushed, 0 skipped. 104.1 MB/s (22575 bytes in 0.000s)
[-] Convert Script to Unix Ending
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[1] Local '22.1' (ENTER)
[2] Canary e136fb3a(22102)
[3] Stable 22.1

[1] You choose Magisk Local Version '22.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[!] We are in an emulator shell
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '22.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] Device SDK API: 30
[-] ARCH32 x86
[-] First API Level: 31
[*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[-] API level greater then 30
[*] Check if we need to repack ramdisk before patching ..
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [lz4_legacy]
[-] Test patch status and do restore
[-] Checking ramdisk status
[-] STATUS=1
[-] Magisk patched boot image detected
[-] Constructing environment - PAY ATTENTION to AVDs Screen
[!] we are root

Also, before you ask, please answer your self the following questions:
  • Did I read AND understood the README.md ?
  • Is my question as detailed and simple as possible couched ?
Host System:

ProductName: Windows OS 11
Android Studio Version: Android Studio Arctic Fox | 2020.3.1 Patch 2
AVD Version: Android 11 (R) API 30 Google Apis Play Store x86_64 r10 Windows Production Build
Magisk Version: Stable 23
Terminal input & output:
./rootAVD.bat InstallApps
[*] Set Directorys
[-] Test if ADB SHELL is working
else was unexpected at this time.
Help Me
 

newbit

Senior Member
Nov 16, 2008
166
68
Host System:

ProductName: Windows OS 11
Android Studio Version: Android Studio Arctic Fox | 2020.3.1 Patch 2
AVD Version: Android 11 (R) API 30 Google Apis Play Store x86_64 r10 Windows Production Build
Magisk Version: Stable 23
Terminal input & output:
./rootAVD.bat InstallApps
[*] Set Directorys
[-] Test if ADB SHELL is working
else was unexpected at this time.
Help Me
Thanks, I can't ensure if the script works on a Windows 11 command line. So please report back
if it works.
If you run the script without an argument, it shows you some examples you can use.
If this is your first run of the script, why do you choose to run it with the InstallApps Argument first?
You should try the following example.
Code:
rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img

You should also read this post #107

Cheers
NewBit
 

albrechtc

New member
Oct 18, 2021
1
0
Please look at this~~~
Windows 11


Bash:
PS D:\Android\rootAVD-master> .\rootAVD D:\Android\AndroidSDK\system-images\android-29\google_apis\x86_64\ramdisk.img
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] ADB connectoin possible
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] looking for Magisk installer Zip
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] D:\Android\rootAVD-master\Magisk.zip: 1 file pushed, 0 skipped. 511.1 MB/s (6874374 bytes in 0.013s)
[-] Backup exists already
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] D:\Android\AndroidSDK\system-images\android-29\google_apis\x86_64\ramdisk.img: 1 file pushed, 0 skipped. 776.6 MB/s (898444 bytes in 0.001s)
[-] Copy rootAVD Script into Magisk DIR
rootAVD.sh: 1 file pushed, 0 skipped. 855.5 MB/s (1998366 bytes in 0.002s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
chmod: /data/data/com.android.shell/Magisk/lib: No such file or directory
mv: bad '/data/data/com.android.shell/Magisk/lib/x86/libbusybox.so': No such file or directory
mv: bad '/data/data/com.android.shell/Magisk/lib/armeabi-v7a/libbusybox.so': No such file or directory
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
[-] Checking AVDs Internet connection...
[!] AVD is offline
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found

Always failed...
 

newbit

Senior Member
Nov 16, 2008
166
68
Please look at this~~~
Windows 11


Bash:
PS D:\Android\rootAVD-master> .\rootAVD D:\Android\AndroidSDK\system-images\android-29\google_apis\x86_64\ramdisk.img
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] ADB connectoin possible
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] looking for Magisk installer Zip
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] D:\Android\rootAVD-master\Magisk.zip: 1 file pushed, 0 skipped. 511.1 MB/s (6874374 bytes in 0.013s)
[-] Backup exists already
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] D:\Android\AndroidSDK\system-images\android-29\google_apis\x86_64\ramdisk.img: 1 file pushed, 0 skipped. 776.6 MB/s (898444 bytes in 0.001s)
[-] Copy rootAVD Script into Magisk DIR
rootAVD.sh: 1 file pushed, 0 skipped. 855.5 MB/s (1998366 bytes in 0.002s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in an emulator shell
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
chmod: /data/data/com.android.shell/Magisk/lib: No such file or directory
mv: bad '/data/data/com.android.shell/Magisk/lib/x86/libbusybox.so': No such file or directory
mv: bad '/data/data/com.android.shell/Magisk/lib/armeabi-v7a/libbusybox.so': No such file or directory
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found
[-] Checking AVDs Internet connection...
[!] AVD is offline
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
/data/data/com.android.shell/Magisk/rootAVD.sh[1463]: /data/data/com.android.shell/Magisk/busybox: inaccessible or not found

Always failed...
My apologies for that inconvenience, this is fixed now.
 

Const_1c

New member
Oct 24, 2021
1
0
Sorry! I have some problen with rootAVD.. What can i do? Thanks
Снимок.PNG
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Hello Fellows,

    here is a little script, rootAVD, I wrote to root Android Studio Virtual Devices with Magisk.
    It is actually just a modified boot_patch.sh from @topjohnwu, which didn't work
    for Android 11 (R), so I tried the script from @shakalaca MagiskOnEmulator.
    Which didn't work for Android 11 (R) either, so I used his decompression routine to
    modify my rootAVD script and now it works with Android 11 (R), Android 10 (Q)
    and Android 7 (Nougat) with all the Google Play Store API Versions.
    Successfully tested with Stock Kernels on Linux, MacOS and Windows.
    Since Android 12 (S) API 31 is a 64 Bit Only System, Magisk Alpha from vvb2060 is needed.
    So, all credits go to all three of them.

    I hope this might come in handy.

    Cheers
    NewBit

    [Update 29.03.2021]
    Added Download Manager Function for bad TLS record
    Please check out the README.md for "up to date" information.

    Requesting for Help!

    Please provide the following information If you are asking for support:
    • Host System
    • Android Studio Version
    • AVD Version
    • Magisk Version
    • Terminal input & output
    Example Templates:
    Host System:
    sw_vers
    ProductName: Mac OS X
    ProductVersion: 10.15.7
    Android Studio Version: 4.1.3
    AVD Version: Google APIs Intel x86 Atom_64 System Image (revision: 2)
    Magisk Version: Stable 22.1
    Terminal input & output:
    Code:
    ./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
    [!] and we are NOT in an emulator shell
    [-] Test if ADB SHELL is working
    [-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
    [-] Magisk installer Zip exists already
    [*] Cleaning up the ADB working space
    [*] Creating the ADB working space
    [-] Copy Magisk installer Zip
    [*] ./Magisk.zip: 1 file pushed, 0 skipped. 153.2 MB/s (6720493 bytes in 0.042s)
    [*] Set Directorys
    [*] create Backup File
    [-] Copy the original AVD ramdisk.img into Magisk DIR
    [*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 286.9 MB/s (2507370 bytes in 0.008s)
    [-] Copy rootAVD Script into Magisk DIR
    [*] rootAVD.sh: 1 file pushed, 0 skipped. 82.8 MB/s (22575 bytes in 0.000s)
    [-] Convert Script to Unix Ending
    [-] run the actually Boot/Ramdisk/Kernel Image Patch Script
    [*] from Magisk by topjohnwu and modded by NewBit XDA
    [!] We are in an emulator shell
    [-] Switch to the location of the script file
    [*] Extracting busybox and Magisk.zip ...
    [-] Checking AVDs Internet connection...
    [!] AVD is online
    [!] Checking available Magisk Versions
    [?] Choose a Magisk Version to install and make it local
    [1] Local '22.1' (ENTER)
    [2] Canary e136fb3a(22102)
    [3] Stable 22.1
    
    [1] You choose Magisk Local Version '22.1'
    [*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
    [!] We are in an emulator shell
    [-] We are now in Magisk Busybox STANDALONE (D)ASH
    [*] rootAVD with Magisk '22.1' Installer
    [-] Get Flags
    [*] System-as-root, keep dm/avb-verity
    [-] Encrypted data, keep forceencrypt
    [*] RECOVERYMODE=false
    [-] KEEPVERITY=true
    [*] KEEPFORCEENCRYPT=true
    [-] Api Level Arch Detect
    [-] Device Platform: x64
    [-] Device SDK API: 30
    [-] ARCH32 x86
    [-] First API Level: 31
    [*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
    [*] Detecting ramdisk.img compression
    [!] Ramdisk.img uses lz4_legacy compression
    [-] taken from shakalaca's MagiskOnEmulator/process.sh
    [*] executing ramdisk splitting / extraction / repacking
    [-] API level greater then 30
    [*] Check if we need to repack ramdisk before patching ..
    [-] Multiple cpio archives detected
    [*] Unpacking ramdisk ..
    [-] Dumping from 0 to 1603441 ..
    Detected format: [lz4_legacy]
    [-] Dumping from 1603441 to 2507370 ..
    Detected format: [lz4_legacy]
    [*] Repacking ramdisk ..
    [-] Test patch status and do restore
    [-] Checking ramdisk status
    [-] STATUS=0
    [-] Stock boot image detected
    [-] Patching ramdisk
    [!] PATCHFSTAB=false
    [!] Skipping fstab.ranchu patch with /dev/block/sda
    [?] If you want fstab.ranchu patched, set PATCHFSTAB=true
    [!] patching the ramdisk with Magisk Init
    Loading cpio: [ramdisk.cpio]
    Add entry [init] (0750)
    Create directory [overlay.d] (0750)
    Create directory [overlay.d/sbin] (0750)
    Add entry [overlay.d/sbin/magisk32.xz] (0644)
    Add entry [overlay.d/sbin/magisk64.xz] (0644)
    Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
    Loading cpio: [ramdisk.cpio.orig]
    Backup mismatch entry: [init] -> [.backup/init]
    Record new entry: [overlay.d] -> [.backup/.rmlist]
    Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
    Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
    Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
    Create directory [.backup] (0000)
    Add entry [.backup/.magisk] (0000)
    Dump cpio: [ramdisk.cpio]
    [*] repacking back to ramdisk.img format
    [!] Rename Magisk.zip to Magisk.apk
    [-] After the ramdisk.img file is patched and compressed,
    [*] pull it back in the Magisk DIR
    [*] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 209.3 MB/s (2918094 bytes in 0.013s)
    [-] pull Magisk.apk to Apps/
    [*] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 236.2 MB/s (6720493 bytes in 0.027s)
    [-] pull Magisk.zip to Apps/
    [*] adb: error: failed to stat remote object '/data/data/com.android.shell/Magisk/Magisk.zip': No such file or directory
    [-] Clean up the ADB working space
    [*] Move and rename the patched ramdisk.img to the original AVD DIR
    [-] Install all APKs placed in the Apps folder
    [*] Trying to install Apps/Magisk.apk
    Performing Streamed Install
    Success
    [-] Shut-Down & Reboot the AVD and see if it worked
    [-] Root and Su with Magisk for Android Studio AVDs
    [-] Modded by NewBit XDA - Jan. 2021
    [!] Huge Credits and big Thanks to topjohnwu and shakalaca
    Code:
    ./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img
    [!] and we are NOT in an emulator shell
    [-] Test if ADB SHELL is working
    [-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
    [-] Magisk installer Zip exists already
    [*] Cleaning up the ADB working space
    [*] Creating the ADB working space
    [-] Copy Magisk installer Zip
    [*] ./Magisk.zip: 1 file pushed, 0 skipped. 50.7 MB/s (6720493 bytes in 0.126s)
    [*] Set Directorys
    [-] Backup exists already
    [-] Copy the original AVD ramdisk.img into Magisk DIR
    [*] /Users/newbit/Library/Android/sdk/system-images/android-S/google_apis/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 339.1 MB/s (2918094 bytes in 0.008s)
    [-] Copy rootAVD Script into Magisk DIR
    [*] rootAVD.sh: 1 file pushed, 0 skipped. 104.1 MB/s (22575 bytes in 0.000s)
    [-] Convert Script to Unix Ending
    [-] run the actually Boot/Ramdisk/Kernel Image Patch Script
    [*] from Magisk by topjohnwu and modded by NewBit XDA
    [!] We are in an emulator shell
    [-] Switch to the location of the script file
    [*] Extracting busybox and Magisk.zip ...
    [-] Checking AVDs Internet connection...
    [!] AVD is online
    [!] Checking available Magisk Versions
    [?] Choose a Magisk Version to install and make it local
    [1] Local '22.1' (ENTER)
    [2] Canary e136fb3a(22102)
    [3] Stable 22.1
    
    [1] You choose Magisk Local Version '22.1'
    [*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
    [!] We are in an emulator shell
    [-] We are now in Magisk Busybox STANDALONE (D)ASH
    [*] rootAVD with Magisk '22.1' Installer
    [-] Get Flags
    [*] System-as-root, keep dm/avb-verity
    [-] Encrypted data, keep forceencrypt
    [*] RECOVERYMODE=false
    [-] KEEPVERITY=true
    [*] KEEPFORCEENCRYPT=true
    [-] Api Level Arch Detect
    [-] Device Platform: x64
    [-] Device SDK API: 30
    [-] ARCH32 x86
    [-] First API Level: 31
    [*] copy all files from /data/data/com.android.shell/Magisk/lib/x86 to /data/data/com.android.shell/Magisk
    [*] Detecting ramdisk.img compression
    [!] Ramdisk.img uses lz4_legacy compression
    [-] taken from shakalaca's MagiskOnEmulator/process.sh
    [*] executing ramdisk splitting / extraction / repacking
    [-] API level greater then 30
    [*] Check if we need to repack ramdisk before patching ..
    [*] After decompressing ramdisk.img, magiskboot will work
    Detected format: [lz4_legacy]
    [-] Test patch status and do restore
    [-] Checking ramdisk status
    [-] STATUS=1
    [-] Magisk patched boot image detected
    [-] Constructing environment - PAY ATTENTION to AVDs Screen
    [!] we are root

    Also, before you ask, please answer your self the following questions:
    • Did I read AND understood the README.md ?
    • Is my question as detailed and simple as possible couched ?
    Also, please include my Username in your Salutation to make sure I will get notice of it.
    I love to help, but asking all the time, where to pick you up, just increases the time period to get
    your issues fixed.

    Download the latest Version:
    Direct: https://github.com/newbit1/rootAVD/archive/refs/heads/master.zip
    Git: git clone https://github.com/newbit1/rootAVD.git

    My thanks to Android AppSec for his wonderful little video about this script.
    Android Studio Emulator (AVD) Rooting with Magisk using rootAVD
    2
    Nice, thanks for your feedback.
    I've never tried to get pass through the SafetyNet Check.
    But If you want to go further, you can try to change your devices fingerprint with MagiskHidePropsConf from @Didgeridoohan.
    So you could pass basicintegrety, and for ctsprofile you can try Universal SafetyNet Fix from @kdrag0n
    Both modules are just awesome and I have them both on my real phone for the same purpose.


    What do you mean by that? If you can't drag and drop the apk to Emulators Display to install it, there is something wrong
    with your ADB connection. I had this quite a lot, but booting the AVD up over the SDK fixed it mostly for me.


    THX , i will test it.
    I test to install Magisk and spoof with Pokemon Go

    Magisk install - Check
    Smalipatcher install - Check
    Pokemon Go install - not check (cant install)
    Joystick install - not check (cant install)

    But i will test more first
    1
    hi, I'am glade it works for you and grateful for your feedback.
    Do you mind telling me on which system and AVD you let the script run?

    My work System:
    OS: MacOS Catalina 10.15.6
    Android Studio 4.0.1
    AVD: Pixel 2 API 30 Android 10.0+ x86_64

    I restart AVD into safemode, then exec

    ./rootAVD.sh ~/Library/Android/sdk/system-images/android-30/google_apis_playstore/x86_64/ramdisk.img

    restart and follow the magisk to fix problem.
    1
    My work System:
    OS: Windows 10
    Android Studio 4.0.1
    AVD: Pixel 2 API 29 Android 10.0+ x86_64

    BUT
    basicintegrity: False
    ctsProfile: False

    And i cant install lot of Apps.
    But root look like the Picture above me
    1
    Well, you don't have to restart the entire Studio, just the AVD. And yes, shutdown and start is mandatory, only rebooting
    doesn't pick up the patched ramdisk.img
    I am glade it worked eventually.

    Just for improvement purposes.

    Did I hint it not well enough? What was missing?
    Or was it just a misreading/misunderstanding on your side?
    I would like to keep the Notes for the script as clear as possible.
    Also, there is always some space to the top left.

    Cheers
    NewBit
    you explained it correctly when I consulted you because the steps you gave me were not included from the beginning and maybe for someone who does not understand a lot, they are lost like me but I hope that with the answer to my question someone else can understand the process and I think it was my mistake, maybe I was writing something wrong, maybe I misspelled the ramdisk path