Automatic cache and temporary files cleaning on Xiaomi smartphones is a feature that should free up memory and speed up the system. MIUI It removes files without warning, such as downloads, photos from messengers, game data or even work documents, and this is a particularly important problem for owners of devices with a small amount of internal memory (32/64 GB), where every megabyte counts.
In this article, we will discuss how to completely disable autocleaning on any Xiaomi, Redmi or POCO smartphone – from budget models (Redmi 9A, POCO M3) to flagships (Xiaomi 14 Ultra, Black Shark 6 Pro). Let’s consider both the standard MIUI 14/15 settings and hidden methods through ADB or third-party utilities. And also answer the key question: “Can autoclean without root rights be turned off?” – yes, and we will show how.
Why does Xiaomi automatically clean files?
The MIUI autoclean function is based on the Smart Optimization algorithm, which analyzes:
- 📱 Occupied space – if less than 10% is free, the system starts to delete the cache.
- ⏳ File age – data that is not used for more than 30 days is considered junk».
- 🔄 Application activity – rarely opened programs are blacklisted».
- 📁 File types – temporary files (.tmp,.log) are the priority, but downloads from Telegram or browser are often affected.
The problem is that MIUI doesn't always correctly define "junk," for example, it can delete:
- 📸 Photo/video from the folder DCIM/.thumbnails (gallery-piece).
- 🎮 Game Resources: Genshin Impact, Call of Duty Mobile).
- 📄 PDF-Documents downloaded via Chrome or Mi Browser.
- 🎵 Music from the Music folder, if it has not been played for a long time.
The main paradox is that auto-cleaning often works even when there is enough memory, due to Xiaomi’s aggressive policy of “optimizing” the background of the system, and in some firmware (for example, MIUI Global for Redmi Note 11), the function is activated by default and hidden in the depths of the menu.
Method 1: Disconnect via “Security Settings” (without root)
The easiest method is to deactivate autocleaning from the standard menu, which works on all devices with MIUI 12-15 (including POCO Launcher):
- Open Settings → Applications → Application Management.
- Tap it on three points (⋮) in the upper right corner and select Special Access.
- Go to the Cleanup. → Autocleaning.
- Turn off the automatic cleaning slider.
If there is no Auto Cleanup, try an alternative route:
- Settings → Memory → Cleaning.
- Push the gear (⚙️) top-corner.
- Deactivate Auto Cleanup and Smart Optimization.
☑️ Preparation before auto-cleaning is disabled
An important nuance: on some models (Xiaomi 13T, Redmi K60) after disabling the autocleaner, the system can automatically turn it back on after restarting, in which case you will need to use the methods from the following sections.
Method 2: Disconnecting through Developer Mode (for experienced)
If the standard method didn't work, try disabling auto-cleaning through the developer's hidden settings. This method doesn't require root rights, but requires care:
- Activate Developer Mode: Go to Settings → About Phone. Tap 7 times on MIUI Version (you will be notified "You are a developer").
Settings → Additional → For Developers
Not to keep up the action
Don’t keep activities
turn off
Background processes
Standard limit
These actions will limit aggressive memory management, but will not shut down auto-cleaning completely.
- 🔧 In the same developer menu, find the Background Limitation and set No Limits for critical applications (e.g., galleries or instant messengers).
- 📵 Disable Optimization MIUI (paragraph may be called MIUI Optimization). ⚠️ Note: Disabling this option may cause some functions to function unstable (such as gestures or animations).
What to do if you don’t have a “MIUI Optimization” option?
Method 3: Excluding folders from autocleaning
If you can't completely disable autoclean, you can add important folders to the exceptions, and this is true for users who want to save:
- 📁 Downloads from the browser (/Download).
- 🎵 Music or podcasts (/Music).
- 📸 Photo from messengers (/Pictures/Telegram).
Instructions:
- Install a file manager with support for hidden folders (such as MiXplorer or Solid Explorer).
- Go to the folder you want to protect (e.g. /storage/emulated/0/Download).
- Create an empty file inside it called.nomedia (no extension) that hides content from the media scanner, but not from the auto-cleaner.
- For reliability, add a readme.txt text file with any content to the folder, which will increase its weight in the eyes of the system.
| folder | What it keeps. | Risk of clean-up | How to protect |
|---|---|---|---|
| /DCIM/Camera | Photo and video from the camera | Low. | Create.nomedia in subfolders |
| /Download | Files from the browser / messengers | High-pitched | Exclude through Settings → Memory |
| /Android/data | Application data (games, cache) | Medium. | Disable cleaning for specific applications |
| /Pictures/Screenshots | Screenshots | Low. | Transfer to the cloud (Mi Cloud or Google Photos) |
⚠️ Warning: Creating a.nomedia file will hide the contents of the folder from the gallery and music players. To regain visibility, delete this file.
Method 4: Disconnect via ADB (for advanced)
If previous methods have failed, you have to turn off auto-cleaning via ADB (Android Debug Bridge), which requires a computer and minimal command line knowledge, but gives 100% results.
Step-by-step:
- Download and install Platform Tools (the official tool from Google).
- On your smartphone, enable USB Debugging: Settings → About Phone → MIUI Version (tap 7 times). Settings → Additional → For Developers → USB Debugging.
adb devicesThere should be a device with a serial number.
adb shell pm uninstall -k --user 0 com.miui.cleanmasterThis command removes the Clean Master application (responsible for cleaning) for the current user.
If the team doesn’t work, try an alternative:
adb shell pm disable-user --user 0 com.miui.cleanmaster⚠️ Attention: After update MIUI You may need to repeat the command, and some functions (such as manual cache cleaning) will become unavailable.
💡
If, after the execution, ADB-Autocleaning commands still work, check for duplicate services. Follow the command adb shell pm list packages | grep clean to find all related packages, and remove them similarly.
Method 5: Using Magisk and Xposed (for rooted devices)
If you have root rights, you can block auto-cleaning completely at the system level.
- 📱 Installed by Magisk (last version).
- 🛠 Xiaomi Debloater or Disable Module MIUI Services.
Instructions:
- Download the Disable MIUI Services module.
- Install it through Magisk Manager (Module section).
- Reset the device.
- After restarting, open the Disable MIUI Services app and find services: com.miui.cleanmaster is the main cleaning module. com.miui.analytics is a stat collection (can affect cleaning triggers). com.xiaomi.midrop is background file optimization.
Turn off these services and restart the phone.
Advantages of the method:
- ✅ Completely shutting down autocleaning without self-repairing.
- ✅ Ability to fine-tune (you can disable only part of the functions).
- ✅ It works even after the updates. MIUI.
⚠️ Note: Disabling system services may cause some features to function unstable (such as dark theme or gestures). TWRP Or OrangeFox.
💡
Using Magisk is the most reliable way to disable auto-cleaning permanently, but requires unlocking the bootloader and root rights. On some models (Xiaomi 12S Ultra, Redmi K50 Pro) this can void the warranty.
What to do if the files have already been deleted?
If the autocleaner has erased important data, try to restore it:
- Check the cart: Open Gallery → Albums → Recycle Bin (files are stored there for 30 days). At Mi File Manager, go to Categories → Recycle Bin.
- Use Recovery Programs to Recover: 📱 On the phone: DiskDigger, Undeleter (requires root for deep scanning). 💻 On PC: Recuva, EaseUS Data Recovery (Plug your phone in File Transfer mode).
Check the cloud copies
- Google Photos (if synchronization is enabled)
- Mi Cloud (in the settings of the Xiaomi account).
- Telegram or WhatsApp (Save Messages tab).
Importantly, the faster you start recovering, the better the chances of returning files. Once deleted, the data stays in memory until it is overwritten with new files.
- 🚫 Do not install new applications.
- 🚫 Don’t take photos or videos.
- 🚫 Don't download files from the Internet.