Hand-cleaning Xiaomi phone from unnecessary files: the complete guide

Why is manual cleaning more effective than automatic cleaning?

Xiaomiโ€™s MIUI-based smartphones are known for their functionality, but over time, even they start to slow down due to the accumulated digital debris. Built-in tools like Cleanup or Security remove only the tip of the iceberg, leaving deep-seated temporary files, remnants of remote applications and duplicate media. Auto cleaners often skip system folders where gigabytes of unnecessary data accumulate, from update logs to the cache of Google Play Services.

Manual cleaning has two key benefits: control over what is being removed, and deep research on hidden directories. /data/local/tmp It can weigh a few gigabytes, but standard tools don't touch it. MIUI into /data/system/package_cache โ€” cleaning it frees up to 1โ€“2 GB space. In this article, we'll discuss how to safely remove garbage manually without damaging the system, and which files can be safely erased and which only when absolutely necessary.

Before you start, remember: on Xiaomi phones with MIUI 14+, manually cleaning the /data/app-lib folder without root rights can cause some applications to fail โ€” this directory is now protected by the system.

Preparation: What to do before cleaning

Incorrect cleaning can result in loss of important data or MIUI failures. To avoid problems, follow three mandatory steps:

  • ๐Ÿ“ฑ Create a backup through Settings โ†’ The phone. โ†’ Backup. It's especially important to save the application data if you're planning to clean folders like this. /Android/data.
  • ๐Ÿ”‹ Charge your phone to at least 50%. Interrupting the cleaning process due to battery discharge can damage the file system.
  • ๐Ÿ› ๏ธ Install a file manager with root access (if you have superuser rights) or a standard file manager. MI File Manager with the option to display hidden files (Settings) โ†’ Show hidden files).

Also check the free space on the device. If it is less than 10%, the system can spontaneously delete the cache of critical applications, which will lead to their unstable operation. The optimal threshold for cleaning is 15-20% of free space.

๐Ÿ“Š How often do you clean your phone from garbage?
Once a week.
Once a month
Only when it starts to brake.
Never cleaned.

โš ๏ธ Note: If your Xiaomi is working on MIUI 13 or older, do not delete files from the folder /data/app manually, this can break the update of apps through Google Play. Use Settings only โ†’ Annexes โ†’ Delete.

Cleaning App Cache: What Can Be Deleted Without Risk

App cache is the main memory eater. Unlike app data (where settings and saves are stored), cache can be deleted with little or no consequences, except for games and instant messengers, where the cache can contain downloaded media files (for example, stickers in Telegram or textures in games).

To clean the cache manually:

  1. Open MI File Manager and go to Internal Memory โ†’ Android โ†’ Data.
  2. Find a folder with the name of the application package (for example, com.whatsapp for WhatsApp).
  3. Inside it will be a cache catalogue, and its contents can be completely removed.

To speed up the process, use this checklist:

Pay special attention to system applications:

AnnexCache folder.Max. Safe size for removal
Google Play Services/data/data/com.google.android.gms/cacheup to 1GB
MIUI System/data/data/com.miui.system/cache300MB
gallery/data/data/com.miui.gallery/cacheup to 500MB (sketch)
browser/data/data/com.android.browser/cachefully

๐Ÿ’ก

If the app starts to work slower after cleaning the cache, give it 5-10 minutes to re-caching the data. For example, Google Maps will load maps longer, but after a few runs it will return to normal speed.

Delete temporary files and system logs

MIUI actively creates temporary files for debugging and updating, most of which are useless to the user, but take up space.

  • ๐Ÿ—‘๏ธ /data/local/tmp โ€” Temporary packet installer files (you can delete everything).
  • ๐Ÿ“œ /data/log โ€” system logs (delete files older) 7 days).
  • ๐Ÿ”„ /cache โ€” cache of updates (cleared only through recovery or after reboot).
  • ๐Ÿ“ฆ /data/system/package_cache โ€” cache APK (You can clean it, but the apps will be updated longer).

For cleaning /cache:

  1. Turn off the phone.
  2. Press Volume Up + Power to enter Recovery.
  3. Select Wipe Cache Partition (not to be confused with Wipe Data!).
  4. Reset the device.

Logs from /data/log can be viewed through applications like Logcat Reader, but for normal cleaning, you just need to delete files with the.log or.txt extension created more than a week ago.

What happens if you delete all the logs?
Without logs, you can't send an error report in support of Xiaomi, but it won't affect the phone. last_kmsg (kernel log) and dmesg (boot log) can make it harder to diagnose problems after a failure.

Cleaning up duplicates and unnecessary media files

Photos, videos and music are often duplicated due to automatic backups (Google Photos, Mi Cloud) or forwarding in messengers.

  1. In MI File Manager, go to Internal Memory โ†’ DCIM or Download.
  2. Sort files by size (Sort โ†’ by size).
  3. Look for duplicates by name (for example, IMG_20230515_123456.jpg and IMG_20230515_123456(1).jpg).

To automate, use applications like Files by Google (built-in Cleanup) or Duplicate Files Fixer, which find duplicates by checksum, not just by name.

Pay special attention to the folders:

  • ๐Ÿ“ธ DCIM/.thumbnails โ€” Photos (can be cleaned completely).
  • ๐ŸŽต Music/.cache โ€” music player cache.
  • ๐Ÿ“ฅ Download - old ones APK-file.

โš ๏ธ Attention: Do not delete the folder DCIM/Camera completely - some applications (like Snapchat) save temporary files there and may stop working.

Cleaning Remains of Remote Applications

When you delete applications through Settings โ†’ Applications often have their folders in /data/data and /Android/obb. These tails can weigh hundreds of megabytes to find them:

  1. Open MI File Manager and go to Internal Memory โ†’ Android โ†’ Data.
  2. Look for folders with the names of remote application packages (e.g. com.tencent.mm for WeChat).
  3. Delete these folders completely (except lib, if it is, you do not need to touch it).

For applications that store data in /Android/obb (usually games)

  • ๐ŸŽฎ Go to the Inner Memory โ†’ Android โ†’ obb.
  • ๐Ÿ—‘๏ธ Delete folders with the names of remote game packages (for example, com.supercell.clashofclans).

If youโ€™re not sure which app fits the package, use services like Package Name Viewer.

๐Ÿ’ก

App residues in /Android/obb can weigh up to 2-3 GB (such as the cache of Genshin Impact or Call of Duty Mobile games) and are completely safe to remove if the game has already been removed.

Optimization of system folders (for advanced users)

This section is for users with root rights or ADB experience. Here we will touch on folders that are not usually recommended to be cleaned unless absolutely necessary, but which can free up significant space.

List of โ€œriskyโ€ but cleaned folders:

folderWhat it keeps.Risks in cleaning
/data/dalvik-cacheDalvik virtual machine cacheApplications will be launched longer after cleaning
/data/app-libApplication librariesApp updates may break
/data/miscMiscellaneous system dataSome settings may be reset.

To clean through ADB (USB debugging is required):

adb shell


su




rm -rf /data/dalvik-cache/*




rm -rf /data/local/tmp/*




exit




exit

After this cleaning, be sure to restart the phone. The first start can take up to 5-10 minutes - this is normal, since the system recovers the necessary files.

๐Ÿ’ก

If, after cleaning /data/dalvik-cache, applications start to fly out, execute the command adb shell cmd package compile -m speed -f to recompile them for Dalvik.

What cannot be removed under any circumstances

Some files and folders are critical to MIUI, and deleting them will result in a bootloop or a complete system failure, and here is the full list of โ€œno-goโ€ directories:

  • ๐Ÿšซ /system โ€” System files (even with root rights, modifying them is dangerous).
  • ๐Ÿšซ /vendor โ€” drivers and firmware of equipment.
  • ๐Ÿšซ /data/system โ€” User settings (delete โ€“ lose all data).
  • ๐Ÿšซ /efs โ€” IMEI and serial numbers (deletion) = ยซbrick-and-mortarยป).
  • ๐Ÿšซ /dev, /proc, /sys โ€” virtual kernel files.

Also, never delete files with extensions:

  • ๐Ÿ“„.Odex โ€“ Optimized System Libraries.
  • ๐Ÿ“„.pk /system/app โ€” system-application.
  • ๐Ÿ“„.Prop โ€“ Configuration files (e.g. build.prop).

โš ๏ธ Note: If you accidentally delete the file from /system, Don't try to restore it manually. The only safe way is to flash your phone over Fastboot or Recovery with official firmware from Xiaomi.

FAQ: Frequent questions about manual cleaning

Can I clean the Download folder completely?
Yes, if you're sure it doesn't need any files, but check it for important documents or APK-Download folder often contains screenshots saved from messengers or archives with drivers.
Why does the app take up a lot of space once the cache is cleaned?
Cache is temporary files that the app creates anew when you use it, like YouTube caches videos for offline viewing, and Google Maps for maps. If the app grows fast, check its settings: it may have automatic caching enabled (e.g., Telegram for Settings โ†’ Data and Memory โ†’ Media Autoboot).
How to clean up the cache of Google Play Services if it weighs several gigabytes?
Google Play Services cache (/data/data/com.google.android.gms/cache) can be cleared in two ways: via Settings โ†’ Apps โ†’ Google Play Services โ†’ Memory โ†’ Clear cache. Manually through the file manager (requires to delete all contents of the cache folder). If Google services (e.g. geolocation or push notifications) are unstable, restart the phone.
Can I delete the Android/obb folder if the game has already been removed?
Yes, folders in /Android/obb are completely safe to delete if the corresponding application or game is uninstalled.These files contain additional data (for example, high-resolution graphics for games), but are not system-specific. Deleting will free up space without any consequences.
What to do if after manual cleaning the phone began to brake?
Probable causes and solutions: ๐Ÿ”„ Restart your phone โ€“ many system processes are restored after a reboot. ๐Ÿ—‘๏ธ Check the vacant space -- if it's less than 10 percent, the system starts to brake. Release another 1-2 GB. ๐Ÿ› ๏ธ Reset your cache settings via Recovery (Wipe Cache Partition). ๐Ÿ“ฑ Check the CPU Temperature โ€“ If the phone is warming up, it may be that the cleanup has triggered background re-indexing of files.