otak info official Logo   
OTAK.INFO
Personal Blog

Hariyanto Lim

정길상 / 鄭吉祥
Home   Last Posts  
 
Please login to see more topics and discussion categories.
 
goto main category list >> Software programming >> Android

Title : How disable LOGCAT output and probably save battery a little.
Total Reply : 0
Total View : 1008


Harry
Harry
Total thread: 131
Total reply: 50

Post #179
How disable LOGCAT output and probably save battery a little.
I have Lenovo P780 for more than couple of years, it is very slow and when I see the LOGCAT output the content is very big and never stop scrolling, I am not able to change all the apps that print logcat but I can disable the logcat functionality completely, please see the following steps and our device need root access.

1. Login as root in adb shell
eg: adb shell
su

2. Mount /system for READ-WRITE (because we need to change some file)
eg: mount -o rw,remount,rw /system

3. Remove file "/dev/log/main" (because this file is the content of the OUTPUT LOGCAT)
eg:
a. go to directory /system/etc/init.d/
b. create a new file nam "69removelogger"
c. the content of the file is:
#-----
#!/system/bin/sh
rm /dev/log/main
#-----

4. Mount /system for READ-ONLY (to avoid other app modify the content of /system)
eg: mount -o ro,remount,ro /system

5. Reboot device
eg: just type "reboot" in adb shell

After reboot, the logcat content can not be seen, not even using AndroidStudio, cheers~

NOTE: I do this because this device is no longer for development, I use it for daily use, so it is okay without LOGCAT function.
Falling in love with the world

Write : 2016-10-13 16:12:32
Last edit : 2016-10-13 16:19:27

If you want to create a new reply then please login first.



www.OTAK.INFO
Since 19 January 2007
Page hit : 712,049

Code update 24th June 2013
Brain is a very capable to solve big problems
but requires constant reminders about how to.
peace bird