1、在产品目录的init.XXX.rc文件中,添加相应的service
service logcat_service /system/bin/logcat -b system -b events -b main
-b radio -k -n 10 -v threadtime -r5000 -f /data/Logs/Log.0/logcat.log
user root
group log system
class main
disabled
2、启动服务的方式
命令行启动
setprop ctl.start logcat_service
or
start logcat_service
代码启动
c++
property_set("ctl.start","logcat_service");
网友评论