Skip to content

Instantly share code, notes, and snippets.

@manero6
Created September 21, 2023 13:29
Show Gist options
  • Save manero6/c896294bbf692aa4a1ae2284270ac4ba to your computer and use it in GitHub Desktop.
Save manero6/c896294bbf692aa4a1ae2284270ac4ba to your computer and use it in GitHub Desktop.
Step-by-step guide on how I install Magisk using adb

Install Magisk via Sideload

💻 => the device running adb (usually a PC)
📱 => the device where Magisk is going to be installed (usually a Phone or Tablet)

📱 Install Magisk App

The app can be found on F-Droid:

Notes

  • 📱 if an older version is installed, update it directly from the Magisk app

💻 Download Magisk

Download the latest Magisk .apk from the official GitHub repo:

💻 Rename .apk to .zip

mv Magisk.VERSION-NR.apk Magisk.VERSION-NR.apk.zip

💻 Reboot device in Sideload mode

sudo adb reboot sideload

Notes

  • 📱 USB debugging mode must be active (under Settings > Developer Options)
  • 📱 the device running adb (💻) must be approved on the receiving device (📱), else no actions will be taken
  • 💻 in case something goes wrong, kill the running server and start over
    sudo adb kill-server

💻 Sideload Magisk

sudo adb sideload /path/to/Magisk.VERSION-NR.apk.zip

Notes

  • 📱 signature verification might fail, I bypass it to install Magisk anyway
  • 💻 adb might show something like Total xfer: 0.90x, this is fine
  • 📱 reboot to system once done

📱 Complete Magisk installation (if needed)

Magisk might need to be re-installed "internally".
This can be done directly from the app.

Notes

  • 📱 a popup will appear
  • 📱 re-install Magisk using the recommended option
  • 📱 once done a reboot option will be shown, reboot
@ahmet020202
Copy link

thanks

@Dimimalinov999
Copy link

Dimimalinov999 commented Nov 12, 2024

dont you have to unlock the bootloader to install magisk?

@pCoder3000
Copy link

dont you have to unlock the bootloader to install magisk?

Yes, to install Magisk, you generally need to unlock the bootloader of your device. Unlocking the bootloader is usually the first step in the process of gaining root access or installing custom recovery and software like Magisk. Here are the typical steps involved:

Unlock the Bootloader: This step is crucial as it allows you to make modifications to the system partition of your device. The process involves enabling developer options, finding the OEM unlocking option, and using specific commands or tools provided by the device manufacturer.

Install a Custom Recovery: While not always necessary, installing a custom recovery like TWRP can simplify the process of installing Magisk.

Flash Magisk: Once the bootloader is unlocked (and optionally, a custom recovery is installed), you can flash the Magisk zip file to gain root access and start managing root permissions on your device.

@bege10
Copy link

bege10 commented Dec 8, 2024

Thank you very much! This saved me after installing (not yet rebooting!) an OTA-update of /e/OS custom ROM killed the running system. So I could not patch the inactive slot with the Magisk App. Your description worked perfect. ❤️
The phone was still reachable via adb. (At the second time I used this procedure I had to lock and unlock the phone to have it reachable with adb.) I first rebooted to sideload mode and installed Magisk as described and afterwards rebooted to the new system.

@miguelzinn0132
Copy link

how to disable signature verification without a custom recovery?

@bege10
Copy link

bege10 commented Jan 2, 2025

how to disable signature verification without a custom recovery?

Here this was not necessary. I just accepted the verification failure during installation and everything worked well.

@manero6
Copy link
Author

manero6 commented Jan 12, 2025

you welcome @bege10 I'm glad this was helpful :)

@bege10
Copy link

bege10 commented Jan 12, 2025

you welcome @bege10 I'm glad this was helpful :)

👍
BTW, I forgot to rename the apk to zip and it still worked. It seems not to be necessary.

@YTKusho
Copy link

YTKusho commented Feb 16, 2025

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment