google / android-emulator-container-scripts

1.82k stars 256 forks source link

How to root android emulated device? #312

Open js361014 opened 1 year ago

js361014 commented 1 year ago

I would like to root device built with https://github.com/google/android-emulator-container-scripts/blob/master/run-in-script-example.sh I tried to use https://github.com/newbit1/rootAVD which uses https://github.com/topjohnwu/Magisk I needed to select proper ramdisk.img file for the device. I ran emu-docker list which gave SYSIMG R android x86_64 30 https://dl.google.com/android/repository/sys-img/android/x86_64-30_r10.zip, so I downloaded https://dl.google.com/android/repository/sys-img/android/x86_64-30_r10.zip and used ramdisk.img from x86_64-30_r10.zip. But when I tried to patch device using Magisk and ramdisk.img I got error Unsupported/Unknown image format, so it seems it's not proper ramdisk.img. How can I get proper ramdisk.img file or how to root the device in another way?