How to completely delete temporary files on Xiaomi: 7 proven ways

Xiaomi smartphones (including the Redmi and POCO lines) eventually start to slow down due to the accumulation of unnecessary temporary files, which take up precious space in memory, slow down the system and can even cause malfunctions in applications. Unlike the application cache, which is manually cleared, temporary files often go unnoticed โ€“ they are created by both the MIUI system and third-party programs.

Compounding the problem, many users donโ€™t know where to look for this โ€œjunk.โ€ Regular Settings โ†’ Storage only deletes a fraction of files, and some temporary data (such as Dalvik cache or residual update files) require special techniques. In this article, weโ€™ll take a look at all possible sources of temporary files on Xiaomi, including hidden folders and system partitions, and show how to safely delete them without risking damage to the OS.

What are temporary files and why should they be deleted?

Temporary files (or temp files) are data that is created by a system or application for short-term use.

  • ๐Ÿ“ Speed up the loading of frequently used items (cache of images, web pages).
  • ๐Ÿ”„ Save intermediate program results (e.g. unsaved documents).
  • ๐Ÿ“ฆ Ensure the correct installation of updates (.apk files, log files).
  • ๐ŸŽฎ Optimize performance in games (shaders, textures).

However, over time, these files accumulate and turn into digital garbage. MIUI file /cache There can be gigabytes of unnecessary data, and apps like Facebook or TikTok store cache even after they're deleted. 6+ For months of use, temporary files are used 1,5 before 5 GB of memory โ€“ and this does not take into account the cache of user applications!

โš ๏ธ Note: Do not confuse temporary files with app cache. cache can be cleared in each application settings, and temporary files are often hidden in system folders and require manual removal or special utilities.

Consequences of ignoring the problem:

  • ๐Ÿข Slowing down the interface MIUI (delays when opening the menu, lags when scrolling).
  • ๐Ÿ”‹ Increased battery consumption (the system spends resources on processing unnecessary data).
  • ๐Ÿ“‰ Application failures (such as sudden closures of Google Play Store or Galery).
  • ๐Ÿšซ Inability to install updates due to lack of space in the section /cache.
๐Ÿ“Š How often do you clean temporary files on your Xiaomi?
Once a week.
Once a month
Only when the phone starts to brake
Never cleaned.

Method 1: Cleaning through the built-in utility "Optimization"

The easiest method is to use the standard Optimization app (formerly Security) that is on all Xiaomi smartphones, which automatically scans the device for unnecessary files, including:

  • ๐Ÿ—‘๏ธ Residual files after uninstallation of applications.
  • ๐Ÿ“‚ Cash miniatures (thumbnails) in the gallery.
  • ๐Ÿ“ฅ Unused. APK-Files (remainders after updates).
  • ๐Ÿ“„ Log files of system and applications.

Cleaning instructions:

  1. Open the Optimization app** (the shield icon on the desktop or menu).
  2. Go to the Cleanup tab** (in some versions of MIUI โ€“ โ€œJunkโ€).

This method removes up to 70% of temporary files, but leaves system caches (like Dalvik-cache) and some application folders intact.

๐Ÿ’ก

If the same files appear again after cleaning the utility, check the applications that create them. Most often, messengers (Telegram, WhatsApp) and social networks (Instagram, TikTok) are to blame.

Method 2: Manually delete temporary files via file manager

For power users, the best way to manually check key folders where temporary data is being stored is important: some folders are hidden, so first enable the display of hidden files in your file manager (for example, in Mi File Manager or Solid Explorer).

The main folders for cleaning:

folderWayWhat can be removedRisk to the system
Cache/data/local/tmp or /cacheTemporary update files, log filesLow.
Thumbnails/storage/emulated/0/DCIM/.thumbnailsImage and video miniaturesLow (to be recreated)
Download/storage/emulated/0/DownloadAPK-files, old downloadsNo.
Dalvik-cache/data/dalvik-cacheAndroid virtual machine cacheMedium (requires root rights)
Log/data/log or /sdcard/logError logs and system logsLow.

Step-by-step:

  1. Open the file manager (such as Mi File Manager) and enable the display of hidden files in the settings.
  2. Cross the path. /storage/emulated/0 (internal memory) and delete the contents of folders: DCIM/.thumbnails โ€” Download - old downloads (pre-check the contents!). Android/data โ€” Here you can store caches of games and applications (delete the folders of remote programs).

/cache

root

ADB

โš ๏ธ Attention: Do not delete folders Android/obb โ€” This is where game data is stored (like Genshin Impact or Call of Duty Mobile) and if it is deleted, it will require re-uploading several gigabytes of data.

Make a backup copy of important data|Check the free space on the device|Close all working applications|Disable synchronization of cloud services-->

Method 3: Clear Dalvik and ART cache via Recovery Mode

Dalvik cache (or ART in newer versions of Android) is optimized data to speed up applications. Over time, it fragments and can take up to 1-2 GB of space. Cleaning through Recovery Mode is the most efficient way, but requires caution.

Instructions:

  1. Turn off your smartphone.
  2. Press the button combination to enter Recovery Mode: For most Xiaomi/Redmi/POCO: Volume up + Power. On some models (e.g. POCO F3): Volume down + Power.

Recovery

Wipe & Reset โ†’ Wipe Cache

Advanced โ†’ Wipe Dalvik Cache

Confirm the action and wait until it is completed (usually takes 1-2 minutes).

Reboot โ†’ System

Once cleaned, the first run of the system may take longer โ€” that's normal, as MIUI reassembles the app cache.

  • โšก Accelerate the opening of applications by 15-30%.
  • ๐Ÿ“‰ Release up to 1.5 GB of memory.
  • ๐Ÿ”„ Errors such as โ€œThe application does not respondยป.
What to do if the phone does not turn on after cleaning Dalvik?
If the device is stuck on the MIUI logo after cleaning the cache through Recovery, follow the following steps: 1. Re-enter Recovery Mode. 2. Select Wipe Data โ†’ Factory Reset (this will lead to a reset!). 3. If it doesnโ€™t help, reflash the device via Fastboot using the Mi Flash Tool. Reason: The /data partition structure may have been damaged or a conflict with custom firmware.

Method 4: Using ADB for deep cleaning

If you have access to a computer, you can use Android Debug Bridge (ADB) to delete temporary files that are not available through standard methods.

  • ๐Ÿ—ƒ๏ธ System cache (/cache).
  • ๐Ÿ“‚ Residual update files (/data/ota_package).
  • ๐Ÿ”ง Log files of the kernel (/data/tombstones).

Instructions:

  1. Install ADB and Fastboot Tools on PC.
  2. Turn on USB debugging on your smartphone: Go to Settings โ†’ About Phone โ†’ MIUI version and tap 7 times on this item to activate Developer Mode. Return to Settings โ†’ Additional โ†’ For Developers and enable USB Debugging.

cmd

Terminal

adb devices

(Your device should be displayed)

adb shell


su




rm -rf /cache/*




rm -rf /data/local/tmp/*




rm -rf /data/log/*




exit




exit

If you donโ€™t have root rights, su commands wonโ€™t work, in which case, limit yourself to cleaning /sdcard/Android/data via ADB:

adb shell rm -rf /sdcard/Android/obb/*/main.*OBB

โš ๏ธ Attention: Rm teams -rf File deletion is irrevocable. Misuse can lead to data loss or system damage!

๐Ÿ’ก

ADB allows you to clear system folders that are not available through standard methods, but you need to be careful. If you are not sure about the commands, use alternative methods.

Method 5: Applications for automatic cleaning

If manual methods seem complicated, you can use third-party utilities, and we tested several applications and selected the most effective ones for Xiaomi:

AnnexFunctionsPlusesCons
SD MaidCleaning cache, duplicates, residual filesDeep scanning, root supportPaid version for full functionality
CCleanerDelete cache, history, temporary filesSimple interface, optimization of RAMAdvertising in the free version
Files by GoogleCleaning up garbage, duplicates, large filesSafe, from Google.Does not remove the system cache
Xiaomi CleanerSpecialized for MIUIIntegration with the system, cleaning DalvikRequires root for some functions

Recommendations for use:

  • ๐Ÿ” Before cleaning, check which files the app suggests you delete (sometimes they flag important data as โ€œjunk).
  • ๐Ÿ›ก๏ธ Avoid โ€œoptimizersโ€ promising to โ€œspeed up your phone by 200%โ€ โ€“ this is often a marketing ploy.
  • ๐Ÿ“Š Repeat cleaning regularly (once every 1-2 weeks) as temporary files accumulate quickly.

๐Ÿ’ก

SD Maid has a โ€œCorpseFinderโ€ feature, which finds residual files from remote applications that standard cleaners do not see.

Method 6: Resetting cache via Safe Mode (Safe Mode)

If the smartphone is slowing down and standard methods do not help, you can try cleaning through Safe Mode.In this mode, only system applications are downloaded, which allows you to delete temporary files blocked by third-party programs.

How to activate Safe Mode:

  1. Turn off the phone.
  2. Press the power button and hold it until the MIUI logo appears.
  3. Once the logo appears, release the power button and immediately press and hold the volume down button.
  4. Hold it until the phone boots into Safe Mode (the bottom left corner will read โ€œSafe Modeโ€).

Further action:

  1. Open the file manager and manually delete temporary files (see Method 2).
  2. Run Optimization** and clean it up (it works more efficiently in Safe Mode).

This method is useful if:

  • ๐Ÿšซ Applications are not removed in the standard way.
  • ๐Ÿ“ฑ Phone freezes when trying to clean.
  • ๐Ÿ”„ You need to delete files that are occupied by system processes.

Method 7: Preventing the accumulation of temporary files

The best way to deal with temporary files is to prevent them from accumulating. Here are some tips for Xiaomi users:

  • ๐Ÿ”„ Turn off automatic app updates in the Google Play Store (or limit it to Wi-Fi only). APK-file.

For advanced users:

  • ๐Ÿ› ๏ธ Install a custom core (such as FrancoKernel) that optimizes cache management.
  • ๐Ÿ“ฆ Use Magisk modules like Universal. GMS Doze to limit background activity of applications.

๐Ÿ’ก

Regular cleaning (once every 1-2 weeks) prevents the accumulation of gigabytes of garbage and prolongs the life of your Xiaomi.

FAQ: Frequent Questions About Temporary Files on Xiaomi

โ“ Can you delete all temporary files without risking the system?
Most temporary files (application cache, thumbnails, logs) can be deleted without consequences. However, some system folders (e.g. /data/dalvik-cache) can cause failures if cleaned improperly. Always back up before mass deletion.
โ“ Why is the disk space not freed after the temporary files are cleaned?
Possible reasons: Files are busy with system processes (try cleaning in Safe Mode). You have device encryption enabled - in which case some folders may appear as busy even though they are empty. Apps (like Google Photos) sync data in the background. Use the DiskUsage app to visualize occupied space.
โ“ How to clear the cache of system applications (e.g. Google Play Services)?
For this: Go to Settings โ†’ Annexes โ†’ App management. Tap three dots in the top right corner and select Show Systems.** Find the app you want (e.g. Google Play Services) โ†’ Warehouse โ†’ Clear the cache. โš ๏ธ Do not click Clear Data** โ€“ this can reset your Google account settings!
โ“ Why Xiaomi is so quickly accumulating garbage?
It's a firmware feature. MIUI: Aggressive caching to speed up work: Background activity of system applications (e.g. Mi Cloud, Security) Residual files after updates (Xiaomi often releases large-scale OTA-Solution: disable unnecessary system applications through Settings โ†’ Apps or use ADB debloatize.
โ“ Can I transfer the app cache to SD-map?
Some applications (like games) allow you to save data to a memory card, but the system cache (Dalvik, ART) It's always in the internal memory. To transfer the cache, use: App2SD or Link2SD (Root permissions are required. In the settings of individual applications (e.g. Spotify), select SD-card. โš ๏ธ Class memory cards A1/A2 (For example, SanDisk Extreme works faster and is better for cache.