yashsingh1/xdaforums huggingface dataset:
[Android Studio] Growtopia Jaw:
Well, I had never thought of the translator as an emulator per se. But now that you've mentioned it, it might probably be an emulator!

To be honest, I only noticed that such a "translator" existed when I first used an Android OS on my laptop known as the Android-x86.org project. Some people do run Android OS on their computers and I think they might be the first (don't quote me on this) to implement such a "translator" onto x86_64 based Android OSes. Maybe sometime we wouldn't notice such things but the translator played a big role in the x86_64 Android space.

Not to say that transferring the arm native bridge capabilities from an AVD image that already has this capability was my goal but I would think of it as adding arm support to Google's AVD image as proven by the Android-x86.org project, Genymotion Android Emulator and other emulators that it could be done. It seems trying different methods of integrating these "libs" wouldn't work for now.

Yeah, I've noticed this exact behaviour at least on my Android 10 AVD image. I never had the chance to test these behaviour on Android 11 and 12. Your findings would definitely be useful to others and myself. I really appreciate it!

My main reason is that Android 11 and 12 is considered to be "too new" for now. Most physical Android smartphones and tablets still run Android 10. There might be some Android 11 smartphones out there but the market share might currently be below 1%. Based on past experiences, newer Android versions might not work well even with some apps that are actively being developed. I think developers tend to target Android API levels that are most being used currently on the market. Android 10 seems to be the latest and safest Android version to use right now.

I guess I have to use Android 11 if I'm going to need arm translation built into these AVD images to run arm APKs.

I would like to thank you for your time and I truly appreciate it!
[Android Studio] newbit:
As a quick & dirty solution, I've created a Magisk Module.

libndk_translation_Module repo

Inside you will find a *.rc file, ndk_translation_arm64.rc , which needs to be installed into the

ramdisk with magisk. I've updated rootAVD accordingly.

After both, I can install now armeabi-v7a and arm64-v8a APKs on an Android 10 AVD.

But the arm64-v8a runs very slow and crashes. The armeabi-v7a works fine.

It might not be perfect, but a good start. I've noticed that odm and vendor props are now missing.

So there is definitely some space to play open.

All credits go actually to remote-android with its native_bridge repo

He published a nice oneliner to gather all files for the magisk module.

[Update 10.05.2021]

My apologies again, I made a mistake. I did not notice that I accidentally ran Android 11 to test the libndk Module.

I noticed this already a few times, that If another AVD is marked, but a different AVD is clicked on Play, it still does

run the marked AVD. I've added an If ro.build.version.release=10 to the customize.sh, to make sure it gets not installed on the wrong AVD.

With the right AVD, Android 10 API 29, it turns out not to run at all in this base setup. There were some permissions and

executions issue with the .rc script. Hence, I put this also inside the module in service.sh. It was just one mount and 4 copies.

After this, the 2 runner binaries gave me the error:

cannot locate symbol "__android_log_set_logger"

The __android_log_set_logger symbol belongs to the liblog.so, and is available since API level 30.

I've added the two liblog.so in the libndk module as well, and finally the error is gone, and armeabi-v7a and arm64-v8a APKs

can be installed, but only the armeabi-v7a does not crash.

Unfortunately due to this newer liblog.so, it breaks the ADB connection, again because of some symbols are missing in the adbd

binaries. To test your arm APKs you have to push them to the AVD before you enable the module. And then install them from within

the running AVD.

In short: libndk translation module works now, with armeabi-v7a, but it breaks the ADB.

Cheers

NewBit
[Android Studio] :
C:\Users\User>rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis\x86\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
[-] C:\Users\User\Magisk.zip: 1 file pushed, 0 skipped. 121.1 MB/s (6874374 bytes in 0.054s)
[*] create Backup File
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] C:\Users\User\AppData\Local\Android\Sdk\system-images\android-30\google_apis\x86\ramdisk.img: 1 file pushed, 0 skipped. 242.5 MB/s (1475652 bytes in 0.006s)
[-] Copy rootAVD Script into Magisk DIR
adb: error: cannot stat 'rootAVD.sh': No such file or directory
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
sh: /data/data/com.android.shell/Magisk/rootAVD.sh: No such file or directory
[Android Studio] newbit:
adb: error: cannot stat 'rootAVD.sh': No such file or directory

only the .bat isn't enough. You should have the whole repo together in one directory.

rootAVD-master
Apps
LICENSE
Magisk.zip
README.md
rootAVD.bat
rootAVD.sh

Try to download the whole repo at once directly and then extract it.

Or use git if you have it installed.

git clone https://github.com/newbit1/rootAVD.git
[Android Studio] AndroidX:
how to install his script in emulator?
[Android Studio] nthp999:
Hi, I had run your script with below command line

rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86\ramdisk.img. However, the script ran until

....

[-] Test patch status and do restore

[-] Checking ramdisk status

[-] STATUS=1

[-] Magisk patched boot image detected

and nothing happens, I waited for several minutes. So, can you help me? My AVD is Nexus 5X - Android 10 - API 29.
[Android Studio] newbit:
README.md

Hi,

looks like this is the second run?! The AVD Screen is supposed to show the grand su permissions pop-up.

If it doesn't pop up, perhaps you did not shut down and restart the AVD.

Other people had reported that issue too,

try to read some pages of this thread, you might find your situation similar.

I never could reproduce that issue myself. If you can give more specific details I can try to get into this situation as well.
[Android Studio] nthp999:
Thanks for your reply. Actually, this is the first time I run this script on my emulator, and I have met this problem. I think maybe I have some mistakes, I will check again. Besides, I see about "boot the AVD into Safe Mode", so I wonder when I boot into Safe Mode, after or before I run your script (in case of the first run). I afraid this action leading to my problem.
[Android Studio] newbit:
Well, it clearly says: [-] Magisk patched boot image detected

So I guess it must be already patched. Perhaps you have more than one AVD System Image installed and mixed up the path?

Regarding the Safe Mode. I was asked to put this in the Readme, that people who stuck on a Boot Loop, caused due to faulty

Magisk Modules, can easily disable those by just booting the AVD into Safe Mode. Safe Mode does disable all Magisk Modules.

And I didn't even know at the time this feature was built in AVDs. I still can't find any official Note about on how to get there or does it

exist. Took me a while to figure the right timing and button out.

So in short, booting into Safe Mode has nothing to do with installing

or running the script. It is only for rescue purpose that you don't have to install everything over.
[Android Studio] nthp999:
Finally, I rooted my emulator successfully. Exactly what you said, I installed the patch of Magisk before, and I just need to follow the next step on Magisk UI to complete the root. Moreover, another mistake, I executed your .bat file on an Android 11 x86 device, which is not listed in your "Successfully tested" list. After reading carefully and changing the suitable version, and it executes on the Android 11 x86_64 device successfully. Thanks for your help, your script saves much time for me.
[Android Studio] newbit:
Nice!!

Android x86 Versions should also work!
[Android Studio] AndroidX:
I tried command after run your script and avd got bootlope any suggestion
[Android Studio] newbit:
I am happy to help, but please stick to the

Requesting for Help!

form. When I know where you started and where

you stuck, I can better help you solving the issue.
[Android Studio] newbit:
Ah ok, so you running it from windows for android-30 with google play store apis.

First things first.

download the whole package and extract the folder somewhere you have access to it, like in downloads.

In your command terminal CD into that folder and run the rootAVD.bat, it shows the help menu.

Start your AVD, once it is up, try the ADB connection, by adb shell, and if it works, exit.

Back to the Windows terminal run the command.

rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img

Follow the instructions on the terminal, usually just Enter. Once it is finished, shut down the AVD,

start it again, and check the Magisk APP. It should show some additional Setup is required and restarts

the AVD automatically. Done!

If you are facing any other issues, please send me your commands you entered and the output you got back.

And just to be clear, you dont run the script from the running AVD within. You run it from the windows command shell,

and the script does the rest. Hope this helps.
[Android Studio] AndroidX:
Thanks it working great i fixd issue myself really appericate your work
[Android Studio] Atavis:
Hello! Having some issues with running the script – it seems that it could not recognize custom ADB location: it's added to %PATH%, I've rebooted the system, but always gets an "ADB not found, please install platform-tools and add it to your %PATH%".

Host: Windows 10 1909 x64

AS Version: 4.1.3

AVD Version: Android 10 with Google Services (sorry idk how to get a proper name)

Magisk version: Stable 23.0

Terminal output:

E:\Робоча\Capture2Text_v4.6.0_64bit\rootAVD-master>rootAVD D:\VirtualPC\Android\Sdk\system-images\android-29\google_apis_playstore\x86\ramdisk.img InstallPrebuiltKernelModules
[*] Set Directorys
[-] Test if ADB SHELL is working
[!] ADB not found, please install platform-tools and add it to your %PATH%

EDITED. I fixed it by simply editing BAT-file: changed line set HOME= in block TestADB
[Android Studio] Jaatontop:
Yes
[Android Studio] pegadroidX:
hi @newbit , i have problem with apps need detect my location.

in AVD don't need apps like fake GPS right?

AVD can set fake location in avd setting right?
[Android Studio] Jaatontop:
No root
[Android Studio] newbit:
Hi,

the actually command with the parameters are missing in your log.

Which System Image are you using?

Can you see the new ramdisk.img in your image folder?

Did you shut down the AVD and than restart it? Softboot/restart doesn't work, the new ramdisk gets

only loaded after the shut down.
[Android Studio] HzJesus:
I don't know anything about these scripts. I only know how to install android studio and sdk. I need to use magisk hide feature from a rooted device. Can you explain step by step as video or text? Or can I directly download and install a rooted device with magisk? waiting for your help pls
[Android Studio] agds23:
Your script worked perfectly in api 30! Thank you!

And taking advantage, do you have any solution for this post?
[Android Studio] newbit:
I don't think there is a big chance to get pass the safetynet in an emulator.

Some of us has already tried it, and failed.

If you do get pass it, I would like to know how you did it.
[Android Studio] agds23:
Okay, I'll keep looking and if I find out I'll come back and post.

I have a personal project to automate with Android UIAutomator an apk through the emulator.

But because I'm not sure if the apk checks safetynet, I'm looking for something along these lines anyway.

I also saw that you made some custom builds available in your github rootAVD profile. Those builds can generate different props of IMEI, MAC andress etc...

With google distributions, these props are always the same.

I tried it with magisk after rooting it as your script. I installed the Edxposed Android Faker module but I'm not sure it's working.
[Android Studio] newbit:
What custom builds are you referring to?

As far as I understood it, the only custom build stuff are the kernel and its modules.

I ve published also some Guides on how to build those your self. But I can't recall If informations

like IMEI, MAC etc are in there!? It is more likely that those data sets are in the fingerprint of the AVD

or somewhere deep in the image file within a config file or so.

I tried once to install a real pixel fingerprint, with MagiskHidePropsConf from @Didgeridoohan.

But it then stuck on a boot loop.
[Android Studio] Rofliex:
Hi, I tried using your guide to get root but came across a problem.

My steps:

1. Create new VM with this settings

Build numb- sdk_gphone_x86_64_arm64-userdebug 11 RSR1.201211.001.A1 7054069 dev-keys

2. Enable USB debugging for ADB

3. Use your '.bat' file for patch with args -> rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis\x86_64\ramdisk.img DEBUG

But magisk was not installed :( Full log :

Spoiler content hidden.
[Android Studio] newbit:
Don't use the DEBUG switch.
[Android Studio] agds23:
I made a mistake. I thought I had seen how rom.

Well, my main task is to manage to hide that the apk is running on a simulator. I will continue analyzing
[Android Studio] Rofliex:
Thx, process was successful, but root not work, even after reboot android VM. Used local version magisk (push enter on switch ver ). Ramdisk has been successfully patched too :\.

Log:

Spoiler content hidden.
[Android Studio] Rofliex:
No, i used only 'adb reboot' , without shutdown. Shutdown is required?

======================

Full shutdown is required. Big thx for your work and help :)
[Android Studio] rk2429:
Hello, my Friend.Thank you for your significant contribution to the Developer community. I have been trying to get my AVD rooted but all in vain. Whenever I run the following command:

"rootAVD "C:\Users\SP\AppData\Local\Android\Sdk\system-images\android-S\google_apis\x86_64\ramdisk.img", I get the following output :

[*] Set Directorys

[-] Test if ADB SHELL is working

[*] no ADB connection possible ,

And the program ends. On other CMD I'm able to start adb shell command using adb. I tried most of the troubleshooting, but nothing worked. I'm on Windows 10. I have downloaded the official system images(29,30) through the AVD Manager in Android Studio as well as I have also tried to place the system images(29,30) posted on your GitHub but nothing works. I have attached a screenshot of the error. Please guide. Thank you.
[Android Studio] newbit:
Hi,

I am sorry for this inconvenience.

What is your exact path location of you adb file?

It seems that I made a mistake with the order in the testadb routine. If adb is not located in a default/expected

location, the script fails. But It shouldn't matter, as long as adb is callable.

This issue was already fixed for the Mac/Linux Version.

I will try to fix this for the Windows Version as well.

Cheers NewBit
[Android Studio] rk2429:
My adb location is %LOCALAPPDATA%\Android\Sdk\platform-tools

My friend Thank you for your Quick Reply. I was using an older version of adb my bad. But now I'm greeted with two additional issues. The first issue is when I switched to the Android studio adb version(platform-tools) the command ran and stopped with a message saying " Please provide magisk.zip" something, although Magisk.zip was already in the rootAVD folder. I closed CMD and again tried to run the command now the second issue is It is taking more time for "Testing if adb shell is working" and ends with "no adb connection possible".
[Android Studio] newbit:
Once you add your adb path via set path, you should be able to connect to the AVD.

magisk.zip is different from Magisk.zip

But If you extracted the rootavd zip, it should be fine.

Perhaps you cannot connect to the AVD via adb, because the old adb server is still running.

So run adb kill-server and try again.

If all the preconditions are met, you should be good to go.
[Android Studio] AndroidX:
[*] 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 rootAVD-master into /data/data/com.android.shell/Magisk

[-] adb: error: cannot stat 'C:\Users\yuvi\Downloads\rootAVD-master': No such file or directory

\rootAVD-master\initramfs.img was unexpected at this time.

i getting this error when i try to patch ramdisk again in my different laptop anyidea?
[Android Studio] phonedroid:
After several attempts, finally the command ran with no errors. Looked like it did the job.

After this, there is no change in the running AVD. Since the instructions aren't clear in github, I attempted a power cycle by choosing the option Restart, and the AVD seems to be stuck with the screen showing "Restarting". I didn't understand why there is documentation on starting the AVD in safe mode, as it is not stated as a step.

I am running an Android R (11) AVD in Windows 10.

Till date, it seems there is no guaranteed mechanism to root an AVD.
[Android Studio] vanshdevgan:
It's not working on m1 mac which is arm based architecture i really need to make it work can someone please figure out an solution for it ?
[Android Studio] newbit:
Check this out please

ARM64 busybox support · Issue #6 · newbit1/rootAVD

Hey! Could you please add a support for MacOS M1 with arm64 emulator?

github.com
[Android Studio] mmm286:
Hi!

Android 9 with windows 10. It seems that don't do anything:

D:\Descargas\rootAVD-master>rootAVD.bat InstallApps

[*] Set Directorys

[-] Test if ADB SHELL is working

[-] ADB connectoin possible

[-] Install all APKs placed in the Apps folder

D:\Descargas\rootAVD-master>adb devices

List of devices attached

emulator-5554 device
[Android Studio] newbit:
Thats right, Android 9 is not supported.

Due that the ramdisk remains inside the system partition. The ramdisk.img is just a dummy file.
[Android Studio] Lebxda:
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.
[Android Studio] newbit:
Thanks for using my script.

Please check out the first page to fill out the question with all details you can provide.

Cheers

Newbit
[Android Studio] notadog:
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
[Android Studio] newbit:
Hi,

did you met the requirements for the script to run?

Can actually connect to the AVD via adb?
[Android Studio] notadog:
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!
[Android Studio] newbit:
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.
[Android Studio] notadog:
Link to the video:
[Android Studio] newbit:
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
[Android Studio] meza000:
hi im error install magisk

[*] Set Directorys

[-] Test if ADB SHELL is working

else was unexpected at this time.

help me
[Android Studio] newbit:
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:

Spoiler content hidden.

Spoiler content hidden.

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 ?
[Android Studio] meza000:
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
[Android Studio] newbit:
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.

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