4/4/2020 Root Android Emulator Mac
I have All Android SDK versions(from 1.5 to 2.3.3), and I tried many methods for getting root in Android emulator. I don't use any Android device and test everything on emulator(AVD).I need to get root access in any one of the Android emulator to use the 'iptables' and 'busybox' functionality. And to use iptables I must have root access. Atleast 'su' command should execute in the terminal emulator.I also installed z4root application,But it takes very long time and doesn't finish rooting, and gets stuck. Some say that if we downgrade the system to below RC30, this way we can get root access.
![]()
If this is true, then how to do this? I use both Linux and Windows OS.Please someone tell me any method to root my emulator. Here is the list of commands you have to run while the emulator is running, I test this solution for an avd on Android 2.2: adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /systemadb push su /system/xbin/suadb shell chmod 06755 /systemadb shell chmod 06755 /system/xbin/suIt assumes that the su binary is located in the working directory. You can find su and superuser here:.You need to run these commands each time you launch the emulator.
![]()
Can anybody show me any method to root Android phone on Mac? We have introduced some easy way about how to root Android device on PC, but few people talk about how to root Android phones or tablets on Mac. Even the most popular root tool - Kingo can only work on Windows operating system. Do you know that you can run Android on your PC or Mac easily without any issues? However, they know you should use an Android emulator.
You can write a script that launch the emulator and root it. For AVD with 5.1.1 and 6.0 I used next script in windows: set adb=adb -s emulator-5558set arch=x64set pie=adb start-server%adb% root%adb% remountrem%adb% shell mount -o remount,rw /system%adb% shell setenforce 0%adb% install common/Superuser.apk%adb% push%arch%/su%pie% /system/bin/su%adb% shell chmod 0755 /system/bin/su%adb% push%arch%/su%pie% /system/xbin/su%adb% shell chmod 0755 /system/xbin/su%adb% shell su -install%adb% shell 'su -daemon&'rem%adb% shell mount -o remount,ro /systemexit /bNeed UPDATE.zip from SuperSU. Unpacked them to any folder. Create bat file with content above. Do not forget specify necessary architecture and device: set adb=adb -s emulator-5558 and set arch=x64. If you run Android above or equal 5.0, change set pie= to set pie=.pie.
You get temporary root for current run.If you got error on remount system partition then you need start AVD from command line. See below first step for Android 7.If you want make it persistent - update binary in SuperSU and store system.img from temp folder as replace of default system.img.How to convert the resulting temporary root on a permanentFirst - it goes to SuperSu.
It offers a binary upgrade. Update in the normal way. Reboot reject.Second - only relevant for emulators. The same AVD. The bottom line is that changes in the system image will not be saved.
![]()
You need to keep them for themselves.There are already instructions vary for different emulators.For AVD you can try to find a temporary file system.img, save it somewhere and use when you start the emulator.In Windows it is located in the%LOCALAPPDATA%TempAndroidEmulator and has a name something like TMP4980.tmp.You copy it to a folder avd device (%HOMEPATH%.androidavd%AVDNAME%.avd), and renamed to the system.img.Now it will be used at the start, instead of the usual. True if the image in the SDK is updated, it will have the old one.In this case, you will need to remove this system.img, and repeat the operation on its creation.More detailed manual in Russian:For android 7 you need run additional steps:1. Need run emulator manually.Go to sdk folder sdktoolslib64qtlib.Run from this folder emulator with options -writable-system -selinux disabledLike this: F:androidsdktoolslib64qtlibF:androidsdktoolsemulator.exe -avd 7.0x86 -verbose -writable-system -selinux disabled.You need restart adbd from root:adb -s emulator-5554 rootAnd remount system: adb -s emulator-5554 remountIt can be doned only once per run emulator. And any another remount can break write mode. Because of this you not need run of any other commands with remount, like mount -o remount,rw /system.Another steps stay same - upload binary, run binary as daemon and so on.Picture from AVD Android 7 x86 with root:If you see error about PIE on execute su binary - then you upload to emulator wrong binary. You must upload binary named su.pie inside archive, but on emulator it must be named as su, not su.pie.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |