System logs on Android are hidden files that record all device activity: from application errors to the history of network connections. Over time, they take up gigabytes of memory, slow down the smartphone and may contain confidential data (for example, geolocation history or device identifiers). However, Android does not provide built-in tools for completely clearing them - you will have to use hidden settings, commands or third-party utilities. data-i="38">deleting logs: from safe (via the developer menu) to radical (resetting to factory settings). We will pay special attention ADB-commands or third-party utilities.
In this article we will analyze all current methods deleting logs: from safe (via the developer menu) to radical (resetting to factory settings). We will pay special attention hidden folders /data/log/ i /cache/which are often ignored even by โexperiencedโ users. We will also explain why some logs are restored automatically and how to prevent this.
Why clear logs on Android?
Logs (event logs) are needed by the system to diagnose errors, but their accumulation leads to serious problems:
- ๐ Slowdown of: log files fragment memory, increasing data access time. On devices with eMMC drives (as opposed to UFS) this is especially noticeable.
- ๐ Charge consumption: background recording of logs consumes up to 5-7% of the charge per day (according to tests on Samsung Galaxy S22 and Xiaomi Redmi Note 12).
- ๐ Data leak: logs can contain
IMEI,MAC addresses, call history and even fragments of correspondence (if applications do not encrypt traffic). - ๐ ๏ธ Problems with updates: an overfilled folder
/cacheoften causes failures when installing OTA patches.
At the same time not all logs are equally important.. For example, kernel logs (kernel logs) are critical for debugging, and event logs (application events) can be deleted without risk. The main thing is not to touch files in /system/log/if you are not a developer.
Method 1: Cleaning through the developer menu
The safest way is to use hidden Android settings. This method is suitable for devices on Android 10+ and does not require root access.
- Activate developer mode: go to
Settings โ About phone โ Build numberand tap on it 7 times. - Return to the main settings menu and open a new section
For developers. - Scroll down to the block
Loggingand select:
| Option | What clears | Recommendation |
|---|---|---|
Clear log errors | Application crash logs (/data/anr/) | Safe for everyone |
Disable HCI logging | Bluetooth connection logs | Useful for problems with headsets |
Kernel log buffer | System logs (/proc/kmsg) | Only for advanced users |
Clear Google Play service data | Google service logs (/data/data/com.google.*/) | May require repeated authorization |
โ ๏ธ Attention: Disabling the option Enable log recording (Enable loggingwill completely stop the collection of new logs, but this may interfere with the operation of some diagnostic tools (for example, Android Debug Bridge).
โ๏ธ Preparing to clear logs
Method 2: Manual deletion via a file manager
If you have root access or a file manager with superuser rights (for example, Solid Explorer or FX File Explorer), you can manually delete logs from key folders. This method is more effective than standard settings, but requires caution.
Main directories with logs:
- ๐
/data/log/โ main system logs (includingkernelandmain) - ๐
/cache/โ temporary files, including update logs (recovery/last_log) - ๐
/data/anr/โ "application not responding" logs (Application Not Responding) - ๐
/data/tombstones/โ memory dumps when applications crash
Instructions:
- Open file manager with root access.
- Go to the root directory (
/) and find folders from the list above. - Delete all files with extensions
.log,.txt,.trace. - For folder
/cache/can be used commandwipe cache partitionin recovery menu.
What happens if you delete all logs?
The system will continue to work, but diagnostic tools (for example, Logcat) will show empty results. Some applications may create new logs the next time you start them.
โ ๏ธ Attention: Do not delete files in /system/log/ โthis may lead to bootloop (device turning on in a loop). Also avoid folders named efs or modem โthey contain critical data for communication.
Method 3: Using ADB commands (without root)
Android Debug Bridge (ADB) allows you to clear logs without root access, but requires connection to a PC. This method is suitable for devices with a locked bootloader (for example, Google Pixel or Samsung Galaxy With Knox).
Steps:
- Install Platform Tools on PC.
- Enable
USB debuggingin the developer settings. - Connect your phone to the PC and run the commands in the terminal:
adb shellsu
logcat -c # Clears the Logcat buffer
rm -rf /data/log/*
rm -rf /cache/*
exit
To clear the logs of a specific application, use:
adb shell pm clear com.example.app
โ ๏ธ Attention: Command rm -rf without specifying the path will delete ALL contents of the current directory. Always double check the path before execution.
If ADB does not recognize the device, try reinstalling the drivers or using the command adb kill-server followed by adb start-server.
Method 4: Specialized applications
For users without technical skills, applications from Google Playthat automate log cleaning are suitable. However, many of them require root or contain advertising. We tested 5 popular utilities on Android 13 Application Android 14:
| Application | Requires. root? | Efficiency | Cons |
|---|---|---|---|
| LogCleaner | โ No | Deletes 60-70% of logs | Leaves system logs |
| SD Maid | โ Yes | Deletes 90% of logs | Paid version for full functionality |
| 1Tap Cleaner | โ No | Deletes 50% of logs | Lots of advertising |
| CCleaner | โ No | Deletes 40% of logs | Collection of user data |
The best choice for most is SD Maid (if there is a root) or LogCleaner (without root). Please note that applications without root cannot clean folders /data/log/ and /cache/ completely.
โ ๏ธ Attention: Some "cleaners" (for example, Clean Master) delete not only logs, but also useful ones application caches, which can lead to re-downloading data and consumption of traffic.
Method 5: Reset to factory settings (extreme case)
If the logs take up a critically large amount of space (for example, >5 GB) and other methods do not help, it remains hard resetThis will delete ALL data, including logs, but also erases:
- ๐ฑ Installed applications and their data
- ๐ธ Photos, videos and music (if not saved to an SD card)
- ๐ Wi-Fi, Bluetooth and account settings
- ๐ Passwords and encryption keys (for example, for WhatsApp or Telegram)
Instructions for modern Android devices:
- Go to
Settings โ System โ Reset settings. - Select
Delete all data (factory reset). - Confirm the action (you may need to enter a PIN code or pattern).
- Wait for the reboot (takes 5-15 minutes).
โ ๏ธ Attention: On devices with FBE (File-Based Encryption) (for example, Pixel 6 or OnePlus 10 Pro) reset may require you to enter the old password even after the procedure. If you forget it, it will be impossible to restore access.
Resetting to factory settings is the only way to completely delete the logs tombstones and anrwhich are usually ignored by other methods.
How to prevent logs from accumulating in the future
To prevent logs from taking up space again, follow these recommendations:
- ๐ Regular cleaning: Use
ADB-commandlogcat -conce every 2-3 weeks. - ๐ซ Limit logging: In the developer settings, disable
Enable HCI loggingandStrict mode. - ๐ฆ Control applications: Remove apps that actively write logs (for example, some VPN clients or antiviruses).
- ๐ง Update the firmware: In new versions of Android (starting from Android 12), logs take up less space due to compression.
For advanced users: you can create cron task (on devices with root) to automatically clear logs on a schedule. Example script:
#!/system/bin/shlogcat -c
rm -f /data/log/*.log
rm -f /cache/*.log
Save it as /system/etc/init.d/clearlogs and set permissions 755.
On devices with Magisk you can use a module LogCleaner Modulethat automatically clears logs every time you reboot.
FAQ: Frequently asked questions about clearing logs
Is it possible to clear logs without root and ADB?
Yes, but only partially. Through the developer menu (Clear error log.) or applications like LogCleaner you can delete up to 60-70% of the logs. Complete cleaning requires root or ADB.
Why do logs appear again after deletion?
Android constantly keeps an event log for diagnostics. To reduce their number, disable unnecessary services in the developer settings (for example, Wi-Fi logging or USB debugging).
Is it dangerous to delete logs for the phone to work?
No, if you do not touch the system folders (/system/). Logs are needed only for debugging. However, some applications (for example, Google Play Services) can create new ones. logs the next time you start.
How to clear the logs on devices with MIUI or EMUI?
On firmware Xiaomi i Huawei additionally clear the folder /data/log/extra/ โit contains logs of proprietary shells. Use MIUI Cleaner or Huawei Phone Manager for secure cleaning.
Can the logs contain my passwords?
Theoretically, yes, if the application records them in clear text (which violates the policy Google PlayHowever, modern ones). applications store passwords in Android Keystore, and not in logs. The risk is higher for older versions of Android (below Android 9).