shakalaca/MagiskOnEmulator

Android-emulator offical AVD

gauravmeena83 opened this issue · 2 comments

I am trying to install magisk on emulator within docker, but it says magisk install incomplete
I am trying to create a distributable image of docker container for other to simple use/test magisk on emulator.

Environment
Hostos: ubuntu 20.04 with docker version 19.03.13

To recreate the error:

$ docker run -it --rm --privileged androidsdk/android-30:latest bash

# avdmanager create avd -n first_avd --abi google_apis/x86_64 -k "system-images;android-30;google_apis;x86_64"
# emulator -avd first_avd -no-window -no-audio &

# cd /opt/
# git clone https://github.com/shakalaca/MagiskOnEmulator.git
# cp /opt/android-sdk-linux/system-images/android-30/google_apis/x86_64/ramdisk.img ramdisk.bk.img
# wget https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip
# wget https://github.com/topjohnwu/Magisk/releases/download/v22.0/Magisk-v22.0.apk

# cp ramdisk.bk.img /opt/MagiskOnEmulator/ramdisk.img
# cp Magisk-v22.0.apk /opt/MagiskOnEmulator/magisk.zip
# bash patch.sh
# cp /opt/MagiskOnEmulator/ramdisk.img /opt/android-sdk-linux/system-images/android-30/google_apis/x86_64/ramdisk.img
# adb -e reboot
# adb wait-for-device

---- magisk is not accessible as command

# adb shell
127|generic_x86_64_arm64:/ $ magisk su                                                                                                                                                                                                                                           
/system/bin/sh: magisk: inaccessible or not found

---- it seems it was installed at /data/user_de/0/com.topjohnwu.magisk/install/magisk....

# adb root
# adb shell
1|generic_x86_64_arm64:/ # /data/user_de/0/com.topjohnwu.magisk/install/magisk --install-module props.zip                                                                                                                                                                        
Incomplete Magisk install

What am I missing.

show me the logcat and dmesg from boot.

sorry for a very long delay ... tried the guide again ... with the latest 22.1 magisk, with android-30. Its working. It keepshowing the update and install in the app, but it works, was able to load some modules as well .... thank you very much for a fantasitc piece of code.