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
| Tool | Type | What it does | Typical use |
|---|---|---|---|
magisk | Binary | Utility functions and entry points for Magisk's daemon | Check versions, remove modules after a bootloop, edit the DenyList |
su | Applet (link to magisk) | MagiskSU: root shells and commands | adb shell su -c '...', apps that need root |
resetprop | Applet (link to magisk) | Reads and changes system properties, including read-only ones | Module system.prop, waiting for boot in scripts |
magiskpolicy (alias supolicy) | Binary | Patches SELinux policy | Fixing a denial, sepolicy.rule in modules |
magiskboot | Binary | Unpacks, patches and repacks boot images; extracts from payload.bin | What the app runs to patch an image; manual inspection |
magiskinit | Binary | Replaces init in a patched image and sets Magisk up at boot | Never 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.
-
Shells and appsGetting root for a command or an appsu
-
System propertiesValues such as
ro.build.fingerprintresetprop -
Magisk daemon (magiskd)Modules, DenyList, settings databasemagisk
-
SELinux policy in the kernelWhat each process may accessmagiskpolicy
-
Boot ramdiskThe first program the kernel runsmagiskinit
-
Image files (boot, init_boot, payload.bin)Before flashing, on the phone or a computermagiskboot
Which tool do I need?
- NoDo you have the image to patch?
- YesPatch 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
- YesWhat do you want to change?
- Run commands as root
- A property value
- An SELinux denial
- Modules or DenyList
magisk(this page)
The magisk command
Run from a root shell (adb shell, then su). The usage text is identical in v30.7 and v31.1.
| Command | Effect |
|---|---|
magisk -c | Print 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 -V | Ask the running daemon for its version / version code. Fails if Magisk isn't running. |
magisk --list | List 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 ZIP | Install a module zip, the same way the app does |
magisk --path | Print 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-device | Print 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.
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.
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
| Command | Effect |
|---|---|
magisk --denylist status | Print whether the DenyList is enforced; exit 0 if it is |
magisk --denylist enable / disable | Turn 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 ls | Print 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 |
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.
- Magisk tools reference (topjohnwu)
- Magisk source: magisk command usage text, native/src/core/magisk.rs at v31.1 (topjohnwu)
- Magisk source: DenyList command line, native/src/core/deny/cli.cpp at v31.1 (topjohnwu)
- Magisk internal details: file structure (topjohnwu)
- Magisk changelog (topjohnwu)
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