USB Debugging Security Settings on Xiaomi: How to Enable
In this article
USB debugging (Security settings) is a second, separate switch on Xiaomi phones that lives under Developer options, next to the normal USB debugging toggle. You turn it on after enabling Developer options and signing into your Mi account, and it is required for apps that automate taps, input or screen control over USB.
Time 10 min · Steps 7 · Level Medium
What the Security Settings Toggle Actually Does
The regular USB debugging switch lets a computer talk to the phone through the Android debug bridge. The extra Xiaomi-only option, usually listed as USB debugging (Security settings), grants a stronger permission: it allows debugging commands that simulate touches, keystrokes and screen input. Automation apps, screen-recording tools and some backup utilities refuse to work until this second switch is on, which is why a phone can show "USB debugging enabled" and still fail the very task you connected it for.
Because it effectively lets a connected computer control the screen, Xiaomi gates it behind a Mi account sign-in. That is the main thing that trips people up, not the menu path itself.
Turning On Developer Options and Both Switches
- Open Settings and find the build info. Go to Settings > About phone and look for the entry named MIUI version, HyperOS version or OS version, depending on your software. Labels can differ slightly by version.
- Tap it seven times. After a few taps a small message appears saying you are a few steps from being a developer; keep tapping until it says you are already in developer mode. Nothing visible changes on the phone beyond this message.
- Open Developer options. Go back to Settings > Additional settings (on some versions Settings > System or a search for "developer") and tap Developer options. If asked, confirm with your screen lock or Mi account password.
- Sign into your Mi account. The security-settings switch checks for a signed-in account, so do this first: Settings > Mi account, or the prompt that appears when you try the switch. Without it the toggle stays greyed out or switches itself back off.
- Enable USB debugging. Find the USB debugging toggle near the Debugging group and turn it on. Accept the warning dialog that spells out what a connected computer can do. This is the switch most guides stop at.
- Enable USB debugging (Security settings). Scroll a little further in the same list for the option with "Security settings" in its name and turn it on. Confirm the dialog, which may ask you to wait a moment or re-enter your Mi account details. A SIM card in the phone is sometimes required here as well.
- Connect and allow the computer. Plug into the PC over USB, and when the phone shows the "Allow USB debugging?" prompt with the computer's fingerprint, tick "Always allow from this computer" and tap Allow.
The Misconception: One Switch Is Not Two
The most common wrong assumption is that USB debugging is a single setting, so once it is on, everything that needs debugging works. On Xiaomi phones it is two settings. If an automation or input-injection app reports that debugging is off while the main toggle is clearly on, the missing piece is almost always the security-settings variant, not a cable or driver problem. The reverse misconception also appears: people assume the security switch replaces the normal one. It does not. Turn on both.
When the Toggle Refuses to Stay On
If the security-settings switch flips back off by itself or shows greyed out, work through these in order, since each one is a known gate on Xiaomi phones:
- No Mi account signed in. Sign in under Settings > Mi account, then try the toggle again. Signing out later can disable it.
- No SIM card inserted. Some builds require an active SIM before granting the permission. Insert a SIM, wait for it to register, and retry.
- Developer options re-locked. If the whole menu has vanished, the phone was reset or the toggle was turned off; re-tap the build entry seven times.
- Install via USB also blocked. If your task installs apps from the PC, the separate "Install via USB" option in the same list needs enabling too, and it can also demand a SIM and a short waiting period after each attempt.
- MIUI optimization turned off. If someone previously disabled MIUI optimization in Developer options, several debugging behaviours change. Turn it back on, reboot, and test again.
Menu names shift between software versions, so if a label does not match word for word, use the search box at the top of Settings and type "USB debugging" to jump straight to the right screen.
A Rule of Thumb for Leaving It On or Off
Keep both switches off except while you are actively using a tool that needs them. The practical habit: enable them when you sit down to do the task, disable them when you unplug the cable. The risk with debugging left on is not the phone in your pocket; it is a public or shared computer. Never accept the "Allow USB debugging?" prompt on a charging point, hotel PC or borrowed laptop, and if you did once, revoke it later from the same Developer options screen where you granted it.
Checking That It Worked
After step 7, the simplest check is the prompt itself: a trusted computer that triggers the "Allow USB debugging?" dialog has a live connection. If your tool has a diagnostics or connection test screen, run it once with only the main switch on, then again with both on, and compare the error message; the difference tells you exactly which permission was missing. If the phone charges but never shows the prompt, swap cables first, since many cheap leads carry power but no data lines.
Official source: Xiaomi Support