Why Xiaomiβs Temp folder is getting clogged with garbage and how to fix it
The Temp folder (or temporary files) on Xiaomi, Redmi, Poco, and Black Shark smartphones is the systemβs real black box, where app caches, log files, undeleted update remnants, and even snippets of downloaded media accumulate. Unlike visible debris in the gallery or downloads, Temp content often goes undetected until the phone starts to slow down or issue notifications of memory shortages.
The manufacturer does not provide direct access to this folder through the standard MIUI file manager, which creates the illusion that it is not available. In fact, temporary files take from 500 MB to 3-5 GB depending on the intensity of the device use. For example, after a major system update (MIUI 14 β MIUI 15), there may be gigabytes of unnecessary data in Temp.
But why doesn't Xiaomi clean this folder automatically? It's about the Android architecture: some apps (especially system ones) block deleting their temporary files because they're "relevant." And users often don't know that they need to clean it manually -- or are afraid to delete something important. We'll figure out how to do it safely.
Where is the Temp folder on Xiaomi and how to access it
Unlike Windows, where the Temp folder is located on the path C:\Users\Username\AppData\Local\Temp, on Xiaomi, its location depends on the version of MIUI and the smartphone model.
- π For MIUI 12-14: /data/local/tmp/ and /sdcard/Android/data/*/cache/ (slip-file)
- π For MIUI 15: /storage/emulated/0/Android/obb/temp/ (may require root rights)
- π The universal path: /data/media/0/.temp/ (It is only visible through Root Explorer)
- π Cash updates: /cache/ and /data/dalvik-cache/ (cleaned through recovery)
To see these folders, you will need:
- A file manager with root access support (e.g. Solid Explorer or FX File Explorer).
- Show hidden files in the manager settings.
- For some ways β unlocked bootloader and superuser rights (Poco F5, Redmi Note 12 Pro+, etc.).
β οΈ Note: Not all files in Temp can be deleted without consequences. /data/local/tmp/ Delete files with the.lock or.tmp extension is usually safe, but.dat and.db are better left unattended.
How to clean the Temp folder without root rights (for most users)
If you don't have root access, don't despair: about 70% of temporary files can be deleted using standard MIUI tools.
1. Cleaning through "Storage" in the settings
The easiest way to do this is to run on all models from Redmi 9A to Xiaomi 14 Ultra:
- Open the Settings β Storage.
- Click Clear in the section "Unnecessary Files".
- Select the following items: Application cache, Downloads (if not necessary), File Residues.
- Confirm the cleanup.
This method removes up to 1-2 GB of garbage, but does not affect deep system temporary files.
2.Use of the built-in "Security App"
The Security app (shield icon) has a hidden deep cleaning function:
- π Open Security. β Optimization.
- π Scroll down to the Deep Cleanup section.
- π Select Residual Files and Cache Updates.
- π Click Clean and restart the phone.
β οΈ Attention: On some firmware (MIUI Global for Poco X5 Pro) item Deep cleaning may not be available. In this case, use the method of ADB (described below).
3. Clean up via Recovery Mode (without data loss)
If the phone is slowing down and standard methods donβt help, try cleaning with Recovery:
- Turn off your smartphone.
- Press Volume Up + Power before the Mi logo appears.
- Choose Wipe & Reset β Wipe Cache (not Factory Reset!).
- Confirm the action and restart.
This method removes update cache and temporary kernel files, but does not affect user data.
Make a backup copy of important data
Battery charge > 50%
Turn off Google sync during cleaning time
Remember passwords from accounts (reentry may be required)-->
Advanced cleaning: ADB-commands to delete temporary files
If standard methods didnβt work and you donβt have root rights, you can use ADB (Android Debug Bridge), which works on all Xiaomi smartphones, including the Black Shark 5 Pro and Redmi K60.
Step 1: Install ADB on your computer
Download Google's Platform Tools and unpack the archive.
- Connect your phone to your PC via USB (enable USB Debugging in Settings β About Phone β MIUI Version β 7 times click on build number β return to Additional β For Developers).
- Open the command line in the ADB folder.
- Enter the command: Adb devices to make sure the device is detected.
Step 2: Teams to clean Temp
Use these commands alternately (don't copy them all at once!):
adb shell pm clear com.miui.cleanmaster # Cleaning the built-in cleaner
adb shell rm -rf /data/local/tmp/* # Delete temporary files (requires rights)
adb shell rm -rf /cache/* # Clearing the system cache
adb shell pm trim-caches 500M # Release of application cacheCritical! rm -rf /data/local/tmp/* can delete files that are necessary for some services (e.g. Mi Cloud) If notifications or sync stop working after cleaning, restart your phone.
What if the ADB canβt see the device?
Cleanup Temp on Xiaomi with root rights: the full guide
If you have root access (for example, through Magisk), you can delete all temporary files, including those hidden from standard methods.
List of safe folders to remove
| The way to the folder | What does it contain? | Can I remove it? |
|---|---|---|
| /data/local/tmp/ | Temporary file systems processes | Yeah (except for the.lock files) |
| /cache/ | Cache updates and Dalvik cache | Yes (cleared when rebooted) |
| /sdcard/Android/obb/temp/ | Temporary game files (such as Genshin Impact) | Yes (but you may need to re-upload) |
| /data/media/0/.temp/ | Hidden Temporary Media Files | Yes. |
| /data/data/*/cache/ | Cache all the apps. | Partially (remove only unused application folders) |
Teams for Termux (with root)
Install Termux from F-Droid, then do:
su
cd /data/local/tmp/
rm -rf .tmp .log
cd /cache/
rm -rf *
exitβ οΈ Note: Delete files in /data/dalvik-cache/ will cause a complete reassembly of the cache at the next run, which will take 5-10 Do this only if you're willing to wait!
π‘
Before cleaning the root-right Temp, back up via TWRP or Swift Backup.This will allow you to restore the system if something goes wrong.
What happens if you donβt clean the Temp folder on Xiaomi?
Many users ignore cleaning temporary files until the phone starts to "glue."
- π’ Slowdown: When filling memory 80%+ The system is starting to hang. For example, the Redmi Note. 11 s 128 GB of memory can slow down already when 100 GB of occupied space, if Temp has accumulated 3-5 GB of garbage.
- π Update failures: If in /cache/ Lack of space, update MIUI This can be a problem with E:Error in. /cache/recovery/last_log.
- π± Overheating: Permanently writing to temporary files increases the load on flash memory, which leads to heating (especially noticeable on Poco). X3 Pro with Snapdragon 860).
- π« Application Errors: Some programs (such as Google Chrome or TikTok) may give an error called βNot enough memoryβ even if there is free space on the disk.
On Xiaomi with 2.2/3.1 UFS (such as the Xiaomi 13T or Redmi K70), the effects are less noticeable thanks to fast memory. But on budget models with eMMC (Redmi 10A, Poco C50), a clogged Temp folder can reduce the life of the drive by 10-15%.
π‘
Regular cleaning of Temp (once every 1-2 months) prolongs the life of flash memory and prevents failures in the MIUI.
How to Automate Temp Cleanup on Xiaomi
To avoid manually clearing temporary files, you can set up automatic cleanup.
1. Task Planner in MIUI
Starting with MIUI 13, the system has a hidden scheduler:
- Open Settings β Battery and Performance β Task Planner.
- Add a new task with parameters: π Time: Weekly (e.g. Sunday, 3:00 a.m) π Action: Cleaning up garbage π Condition: When connecting to Wi-Fi
Applications for automatic cleaning
Third-party utilities that work without root:
- π§Ή SD Maid (has CorpseFinder function to search for residual files).
- ποΈ Files by Google (Cleanup has an option for temporary files).
- π CCleaner (can clean the cache) MIUI, but may remove too aggressively).
Tasker with Secure Task plugin is suitable for root users.
ACTION: Run Shell [Command: rm -rf /data/local/tmp/; rm -rf /cache/]
CONTEXT: Time [Every: 7 days]3. Script for Termux (advanced users)
Create a file. clean_temp.sh contents:
#!/bin/bash
echo "Cleaning Temp on Xiaomi..."
su -c "rm -rf /data/local/tmp/*"
su -c "rm -rf /cache/*"
"Ready! Reset the device."Then add it to the cron via Termux:
pkg install termux-api
termux-job-scheduler --schedule '{"period_ms":604800000, "command":"bash clean_temp.sh"}'