How to turn off the switch on Xiaomi phone: the complete guide

Accidentally pressing the power button on a Xiaomi smartphone can interrupt an important process, turn off the device at the most inopportune moment, or even cause a reset. This is especially true for users who often carry a phone in their pocket, exercise or work in vibration. Fortunately, MIUI firmware has several ways to limit the functionality of a physical button, from standard settings to hidden capabilities for power users.

In this article, we will discuss 5 proven methods to disable or modify the behavior of the off button on Xiaomi, Redmi and POCO smartphones (including models on MIUI 12-14 and HyperOS). You will learn how to completely block the button, reassign its functions or restrict access to the power menu without root rights. Important: some methods require activation of the developer mode or connection to the PC โ€“ we will describe each step in detail.

Why do you need to turn off the off button?

At first glance, the idea of blocking the power button seems strange, but in practice it solves a few real problems:

  • ๐Ÿ”„ Accidental taps in your pocket or bag leading to your phone rebooting or turning off.
  • ๐Ÿ‘ถ Protect against children who may accidentally turn off the device or start resetting.
  • ๐Ÿ”ง Interrupting critical processes: software updates, video recordings, file transfers.
  • ๐Ÿ›ก๏ธ Security: Blocking access to the recovery menu (Fastboot/Recovery) on a stolen phone.
  • ๐ŸŽฎ Game mode: preventing exit from the game by pressing the side buttons.

According to service centers, up to 15% of calls with โ€œnon-includedโ€ Xiaomi smartphones are associated with an accidental reset via the power menu. Especially vulnerable models with sensitive mechanical buttons: Redmi Note 10 Pro, POCO X3 Pro or Xiaomi 11T. At the same time, the manufacturer does not provide a built-in option to completely disable the button โ€“ it needs to be adjusted manually.

โš ๏ธ Warning: Turning off the power button does not block the ability to turn off the phone via the software menu or adb shell reboot command -p. This only protects against physical pressure.

๐Ÿ“Š Why do you want to turn off the switch button?
Random taps in your pocket
Protection from children
Interrupting updates/downloads
Game mode
Other

Method 1: Use the Safe Button mode (MIUI 12โ€“14)

The easiest method is to activate the hidden โ€œSafe buttonโ€ function, which blocks short-press reactions, which is available on most Xiaomi devices without root rights, but must be enabled beforehand through the developer settings.

Instructions:

  1. Activate Developer Mode: Go to Settings โ†’ About Phone. 7 times click on the MIUI version (you will be notified "You became a developer").
  • Open the settings โ†’ Additional โ†’ for developers.
  • Find the option Safe Power Button (or Safe Power Button in English firmware).
  • Activate the switch and select the delay (recommended 3 seconds).
  • Save the changes and test the button.

Limitations of the method:

  • It does not block long-term retention (the shutdown menu remains available).
  • On some models (POCO F3, Redmi K40) the power button reassignment option may not be available.

๐Ÿ’ก

If the menu doesnโ€™t have the power button reassignment option, try upgrading MIUI to the latest version or install an alternative launcher (like Nova Launcher) that supports gesture management.

Method 3: Blocking through ADB (no root rights)

For advanced users ready to connect the phone to a PC, there is a way to turn off the power button response via Android Debug Bridge (ADB).This method does not require root rights, but requires installing drivers and enabling debugging over USB.

Step-by-step:

  1. Preparation: Download ADB Tools for Windows/macOS/Linux. Enable USB Debugging on your phone in Settings โ†’ Developer. Connect your phone to your PC and confirm debugging permission.
adb shell


settings put global power_button_behavior 0

Where 0 is a complete shutdown of the reaction to the button (alternative values: 1 is only a short press lock, 2 is a double press lock).

adb reboot

To return the standard button behavior, do:

adb shell settings put global power_button_behavior null

โš ๏ธ Note: Some HyperOS firmware (e.g., Xiaomi) 13/14) This command may not work because of the system's changed architecture, and you'll need to use Shizuku or root access.

The importance of the teamThe effectApplicable to
0Complete disregard for pressingMIUI 12โ€“13, Android 10โ€“12
1Short press lockingAll versions of MIUI
2Double-press lockingMIUI 14, HyperOS
nullReturn of Standard BehaviorAny firmware.

Method 4: Using blocking applications (without root)

If previous methods donโ€™t work, you can use third-party apps that intercept button clicks.The best options for Xiaomi are:

  • ๐Ÿ”’ Button Remapper โ€” allows you to reassign the actions of the buttons, including power lock. ADB Shizuku.
  • ๐Ÿ›ก๏ธ Power Button Lock โ€“ a special application for blocking the shutdown button (requires permission) SYSTEM_ALERT_WINDOW).
  • ๐ŸŽ›๏ธ MacroDroid โ€“ creates macros that ignore button presses in certain conditions (e.g. during games).

Example of the configuration in Button Remapper:

  1. Install the app from Google Play.
  2. Provide access through ADB: adb shell pm grant com.flar2.homebutton flar2.homebutton.permission.WRITE_SECURE_SETTINGS
  3. Select Power Button โ†’ Disable from the app.

Cons of the method:

  • Applications may conflict with MIUI system services.
  • After updating the firmware settings may reset.
  • Some apps require the purchase of a Pro version for full functionality.

What to do if the application does not work?
If after installing the blocker, the power button still responds to presses: 1. Check if the rights are included SYSTEM_ALERT_WINDOW for application to Settings โ†’ Annexes โ†’ Special access. 2. Restart your phone โ€“ some services are activated only after a reboot. 3. Try an alternative app (e.g. Button Mapper instead of Button Remapper). 4. HyperOS may require a retracement to MIUI 14 Or use Shizuku instead of using it. ADB.

Method 5: Completely disable the button via TWRP (for advanced)

If you need to permanently disable the power button (for example, to protect against resetting settings on a stolen phone), you can edit system files through custom recovery TWRP. This method requires an unlocked bootloader and a TWRP installed.

Instructions:

  1. Install TWRP for your model (instructions are available on XDA Developers).
  2. Download the file. power_button_disabler.zip (Available in thematic telegram channels on Xiaomi).
  3. Go to TWRP โ†’ Install and select the downloaded file.
  4. Sweat zip and run the Wipe cache.
  5. Reboot the phone.

This method completely removes the power button handler at the kernel level, so to return functionality, you need to flash the original boot.img or repeat the procedure with the cancel file.

โš ๏ธ Attention: Incorrect actions in TWRP You can make a phone "brick" before you back up the boot and system partition. TWRP โ†’ Backup.

๐Ÿ’ก

Use the TWRP method only if you are confident in your actions. For most users, 1-3 methods are sufficient (without the risk of system damage).

Frequent problems and solutions

When you turn off the power button, you may encounter the following difficulties:

Problem.Reason.Decision
The button is not blocked through ADB.Limitations of HyperOS or the new version of MIUIUse Shizuku instead of ADB or retrace to MIUI 13
The phone doesnโ€™t turn off even through the menu.Conflict with the blocking applicationDisable the app or run adb shell reboot -p
After the update, the settings were reset.Systemic reset of global parametersRepeat settings via ADB or use MacroDroid with auto-run
Double pressing for the camera does not workConflict with button reassignmentEnable the option in Settings โ†’ Display โ†’ Button and gestures

If none of the methods worked, check:

  • Firmware Version: On HyperOS (e.g. Xiaomi 14), some features can be blocked.
  • Root rights: Some applications require Magisk to work full time.
  • Google Services Activity: On some devices, Google Play Services override button settings.

Can I turn off the switch without a PC?
Yes, use Method 1 (Safe Button) or Method 2 (Reassign through Settings) and applications like Power Button Lock will also work, but they require special permissions.
Will the lock work after resetting the settings?
No, all power button settings (including ADB-They're resetting to the factory. After the hard reset, you're going to have to reset the setup.
How to turn off the phone if the power button is turned off?
Use alternative methods: Command via ADB: adb shell reboot -p. Program menu: Settings โ†’ About phone โ†’ Shutdown (on some firmware). Voice assistant: say "OK, Google, turn off the phone" (set up required). Applications like Quick Reboot (to root).
Why is the Xiaomi 13/14 not running the ADB button lock team?
HyperOS (new firmware for Xiaomi 13/14) restricts access to some system settings. Solutions: Use Shizuku instead of ADB (requires installation of the Shizuku app); rollback to MIUI 14 via Fastboot (risky, may violate the warranty); Install custom software (e.g. Pixel Experience).
Can I block the off button on POCO F5?
Yes, on POCO F5 (other models POCO) All of the described methods work except: Reassign button through Settings โ†’ Button and gestures may not be available. HyperOS (if installed) will require Shizuku to use the device. ADB-We recommend starting with Method 1 ("Safe button") or the Button Remapper app.