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.
โ ๏ธ 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:
- Open MI File Manager and go to Internal Memory โ Android โ Data.
- Find a folder with the name of the application package (for example, com.whatsapp for WhatsApp).
- 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:
| Annex | Cache folder. | Max. Safe size for removal |
|---|---|---|
| Google Play Services | /data/data/com.google.android.gms/cache | up to 1GB |
| MIUI System | /data/data/com.miui.system/cache | 300MB |
| gallery | /data/data/com.miui.gallery/cache | up to 500MB (sketch) |
| browser | /data/data/com.android.browser/cache | fully |
๐ก
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:
- Turn off the phone.
- Press Volume Up + Power to enter Recovery.
- Select Wipe Cache Partition (not to be confused with Wipe Data!).
- 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?
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.
- In MI File Manager, go to Internal Memory โ DCIM or Download.
- Sort files by size (Sort โ by size).
- 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:
- Open MI File Manager and go to Internal Memory โ Android โ Data.
- Look for folders with the names of remote application packages (e.g. com.tencent.mm for WeChat).
- 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:
| folder | What it keeps. | Risks in cleaning |
|---|---|---|
| /data/dalvik-cache | Dalvik virtual machine cache | Applications will be launched longer after cleaning |
| /data/app-lib | Application libraries | App updates may break |
| /data/misc | Miscellaneous system data | Some 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
exitAfter 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.