Installation - GitCourser/MagiskOnEmu GitHub Wiki
- Run this command on Termux app to clone Magisk installer script into Termux
~/magiskonemu
directory:
pkg install git
git clone http://github.com/huskydg/magiskonemu
- Run script:
- Live mode: Run this command on Termux app to run Magisk installer script:
sh ~/magiskonemu/run.sh
- GearLock Recovery Mode (Android x86 only): Open Virtual Terminal and type:
/data/data/com.termux/magisk/menu
Run script in GearLock Recovery Mode will always have root access.
If you want to integrate Magisk into official AVD, please patch ramdisk image using official avd_patch.sh from topjohnwu
It's difficult (still possible) to install Magisk into ramdisk image on NoxPlayer, MumuPlayer, etc... because the partition that store ramdisk does not have enough space to put magisk binaries.
So we are going to install Magisk into system partion.
-
Go to emulator settings, enable built-in Root and reboot.
-
Run Magisk installer script with root access
-
Go Install/update Magisk > Select Magisk build > Install Magisk into system
-
Go to emulator settings, disable built-in Root and reboot.
-
Launch emulator and enjoy Magisk.
Also Read the AndnixSH's post on PlantinMods for more information if you are still confusing
Show all
-
Video: How to install Magisk and Bluestacks emulator - Android 9
-
Recommended to install Magisk into Android 9 Pie 64-bit.
-
You can install Magisk into Ramdisk or system partition. Ramdisk method is recommended. You can only choose one!
-
Download lastest BSTweaker for debugging Bluestacks
-
You will need BSTweaker tool to Unlock the instance. The Unlock seems like Unlock bootloader on actual devices. Unlock the instance by Bluestacks Tweaker to be able to apply Magisk to system. If you don't Unlock the instance you cannot modify any thing (include
ramdisk.img
, system partition) in instance even with built-in root access from Bluestacks -
Press Patch button to provide
/system/xbin/su
for root -
Run Magisk installer script with root access
- If you install Magisk into Ramdisk, select
/dev/block/sda1
partition in Partitions Table
-
Press UnPatch button to disable
/system/xbin/su
-
Reboot the Bluestacks instance, enjoy Magisk
IMPORTANT!! Do not Lock the instance by BSTweaker as Magisk will be wiped as well. Only do when you meet trouble with Magisk
MagiskOnEmu is deprecated for Android-x86 project! Installing Magisk into Android-x86 is now much easier and more convenient. No need to directly patch initrd, ramdisk or system image. Please refer to initrd-magisk instead.
Show all
-
Run Magisk installer script by these way with root access or in GearLock Recovery
-
Go Install/update Magisk > Select Magisk build > Install Magisk into ramdisk > Direct install
- It is difficult to detect target ramdisk image so Magisk on Android x86 has to scan all partitions to find ramdisk. If the script cannot find ramdisk so you can manually choice partition and target ramdisk.
- Then Magisk Terminal will patch
ramdisk.img
install Magisk into ramdisk. The old/originalramdisk.img
will be backed up asramdisk.img.bak
so you can always use it to remove Magisk if you meet trouble.
-
Remove old root method if you want Magisk work properly and hiding root.
-
Reboot Android x86 and enjoy Magisk.
Follow the installation guide above
This method is deprecated, please use ramdisk/initrd or system method instead!
-
If you don't have root permission: Run Magisk installer script, then go Install/update Magisk > Select Magisk build > Install Magisk by using GearLock > Export GearLock extension (GXP) and Magisk Terminal will build an extension and save it to
/sdcard/Magisk
. After that reboot into GearLock in Recovery Mode and install extension. Note: In Recovery Mode, the path to Internal Storage may be/data/media/0
instead of/sdcard
-
If you have Magisk installed: It's recommended to use Direct Install. Run magisk installer script, then go Install/update Magisk > Select Magisk build > Install Magisk by using GearLock > Direct Install
- This Magisk initialization cannot coexist with
rusty-magisk
, you need to removerusty-magisk
. If you saw/init.real
in root directory, you mostly haverusty-magisk
installed. To remove rusty-magisk, move/init.real
to/init
in ramdisk or system image (Android 10+). - You should not install rusty-magisk module from GearLock, it will always be removed!
- To make Magisk work properly and able to hide, you will need to perform Remove all other Root method and your system must be writeable. For emulator, you just need to toggle off Root option in Settings.
- You can only choose one method to install Magisk, that means when you Update Magisk you must use the same method that you installed Magisk with. Do not use multiple methods to install Magisk.
- Since Android Emulator and Android x86 usually will not have
boot.img
, you cannot update it through Magisk app directly. Use Magisk Terminal app to update Magisk.
You can remove magisk from ramdisk or system through Uninstall Magisk option of this script.