Tools

Magisk command-line tools

Magisk ships four binaries and a few applets. Most people only ever use the Magisk app, but these tools are what the app, modules and power users run underneath. This page tells you which tool fits which job and documents the magisk command itself.

Last updated 5 sourcesHow we check pages

What's included

ToolTypeWhat it doesTypical use
magiskBinaryUtility functions and entry points for Magisk's daemonCheck versions, remove modules after a bootloop, edit the DenyList
suApplet (link to magisk)MagiskSU: root shells and commandsadb shell su -c '...', apps that need root
resetpropApplet (link to magisk)Reads and changes system properties, including read-only onesModule system.prop, waiting for boot in scripts
magiskpolicy (alias supolicy)BinaryPatches SELinux policyFixing a denial, sepolicy.rule in modules
magiskbootBinaryUnpacks, patches and repacks boot images; extracts from payload.binWhat the app runs to patch an image; manual inspection
magiskinitBinaryReplaces init in a patched image and sets Magisk up at bootNever run by hand; see how Magisk works

On a rooted phone the tools live in Magisk's tmpfs directory (magisk --path), and Magisk also places magisk, magiskpolicy, su, resetprop and supolicy in a PATH directory so you can call them by name. A full copy, including magiskboot and BusyBox, is kept in /data/adb/magisk. Most commands need root, with exceptions noted below: magisk -c, -v and -V work from a normal adb shell, and so does magisk --remove-modules. Not sure which image to patch or what to flash? The root method checker asks a few questions and gives you the commands.

Which tool for which job

Where each tool works

Top: the running phone. Bottom: image files before they are flashed.

  1. Shells and appsGetting root for a command or an app
    su
  2. System propertiesValues such as ro.build.fingerprint
    resetprop
  3. Magisk daemon (magiskd)Modules, DenyList, settings database
    magisk
  4. SELinux policy in the kernelWhat each process may access
    magiskpolicy
  5. Boot ramdiskThe first program the kernel runs
    magiskinit
  6. Image files (boot, init_boot, payload.bin)Before flashing, on the phone or a computer
    magiskboot
From Magisk's tools reference and internal details documentation, checked 26 October 2026 against the source at tags v30.7 and v31.1.

Which tool do I need?

Is Magisk installed and running yet?
  • No
    Do you have the image to patch?
    • Yes
      Patch it in the Magisk app. magiskboot only for manual work.
    • No, only an OTA zip
      magiskboot extract payload.bin, or let the v31.1 app extract it
  • Yes
    What do you want to change?
A starting point; each tool's page has the details. Based on Magisk's tools reference, checked 26 October 2026.

The magisk command

Run from a root shell (adb shell, then su). The usage text is identical in v30.7 and v31.1.

CommandEffect
magisk -cPrint the installed binary's version and version code. Works even if the daemon is not running, which makes it the first check when root seems missing.
magisk -v / magisk -VAsk the running daemon for its version / version code. Fails if Magisk isn't running.
magisk --listList the applets (su, resetprop)
magisk --remove-modules [-n]Run each module's uninstall.sh, delete every module, then reboot (-n: don't reboot)
magisk --install-module ZIPInstall a module zip, the same way the app does
magisk --pathPrint Magisk's tmpfs directory (/sbin or /debug_ramdisk); exit 1 if Magisk isn't set up
magisk --denylist ...Show or edit the DenyList (next section). Root only; otherwise Root is required for this operation.
magisk --sqlite "SQL"Run SQL against Magisk's database, /data/adb/magisk.db. Root only.
magisk --preinit-devicePrint the partition Magisk would use for pre-init storage

Magisk's usage text files --path, --sqlite, --denylist and --preinit-device under "Advanced Options (Internal APIs)", together with options meant only for Magisk's own scripts: --daemon, --stop, --post-fs-data, --service, --boot-complete, --zygote-restart, --unlock-blocks, --restorecon, --clone-attr and --clone. Don't run those by hand; --stop, for example, undoes Magisk's changes and stops the daemon until the next reboot.

Recover from a module bootloop over ADB
# needs USB debugging, already authorized; waits for the phone to show up during boot $adb wait-for-device shell magisk --remove-modules

No su grant is needed: Magisk's daemon accepts this one request from the ADB shell user as well as from root (any other app gets Accessed denied). It runs each module's uninstall.sh, deletes the modules and reboots. If ADB never connects, use Safe Mode instead. Full steps: fixing a Magisk bootloop.

Inspect settings and root grants (read-only)
#magisk --sqlite "SELECT * FROM settings" #magisk --sqlite "SELECT uid, policy FROM policies"

The database has policies (root grants by UID), settings and denylist tables. Change settings in the Magisk app rather than with SQL; it is an internal interface.

DenyList from the command line

CommandEffect
magisk --denylist statusPrint whether the DenyList is enforced; exit 0 if it is
magisk --denylist enable / disableTurn enforcement on or off (the app's Enforce DenyList)
magisk --denylist add PKG [PROC]Add a process. Without PROC it adds only the process named like the package, not the app's other processes.
magisk --denylist rm PKG [PROC]Remove one process, or all of the package's entries without PROC
magisk --denylist lsPrint the list as package|process, one per line
magisk --denylist exec CMD...Run a command in an isolated mount namespace with all DenyList unmounts applied
Example: add a banking app and its extra process
#magisk --denylist add com.example.bank #magisk --denylist add com.example.bank com.example.bank:remote #magisk --denylist ls | grep com.example.bank # what does the system look like to a DenyListed process? #magisk --denylist exec sh -c 'command -v su || echo "no su"'

Messages you may see: Target already exists in denylist, Target does not exist in denylist, Invalid package / process name (the package isn't installed or the name is malformed) and The kernel does not support mount namespace. The DenyList only reverts Magisk's changes in those processes; it does not hide root by itself. For banking and payment apps, see getting banking apps to work. The app-hiding feature that once complemented it was removed in v31.1.

What changed in the tools in v31

The current stable release is v31.1 (October 25, 2026). Between v30.7 and v31.1 the magisk command and magiskpolicy did not change. The changes that affect scripts are in su (no prompts, arguments forwarded to the shell, option order), resetprop (new --compact) and magiskboot (sign renamed sign-avb1, new sign-chromeos, zopfli removed). For how the pieces fit together at boot, see how Magisk works; for writing modules that use them, module development.

Sources

This page is written from the sources below. If anything here disagrees with them, the upstream source is correct.

Found a mistake or something out of date? Tell us and we will check it against the source and fix the page. Confirmed corrections are listed in the corrections log.

Report a problem with this page