Skip to content

Instantly share code, notes, and snippets.

@manero6
Created September 21, 2023 13:29
Show Gist options
  • Select an option

  • Save manero6/c896294bbf692aa4a1ae2284270ac4ba to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

thanks

@Dimimalinov999

Dimimalinov999 commented Nov 12, 2024

Copy link
Copy Markdown

dont you have to unlock the bootloader to install magisk?

@pCoder3000

Copy link
Copy Markdown

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

bege10 commented Dec 8, 2024

Copy link
Copy Markdown

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
Copy Markdown

how to disable signature verification without a custom recovery?

@bege10

bege10 commented Jan 2, 2025

Copy link
Copy Markdown

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

manero6 commented Jan 12, 2025

Copy link
Copy Markdown
Author

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

@bege10

bege10 commented Jan 12, 2025

Copy link
Copy Markdown

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.

@Said-Habibi

Copy link
Copy Markdown

thanks

@patrickwsmith2

Copy link
Copy Markdown

My oem unlocking is unavailable. What do I need to do to install magisk? I'm really just trying to install android 15 or newer on my Samsung Galaxy A51 model code SM-S515DZKATFN

@Wakelock

Wakelock commented Aug 2, 2026

Copy link
Copy Markdown

Signature verification failed

@Wakelock

Wakelock commented Aug 2, 2026

Copy link
Copy Markdown

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

Mine just cancels immediately and disconnects from ADB

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