android 系统日志写入sd卡

说明

公司有需求,将系统日志写入到SD卡(系统日志和内核日志)。

实现

添加位置:/device/qcom/msm8953_64

添加执行脚本:init.qcom.corelog.sh

#!/system/bin/sh
#
#  Script : init.qcom.corelog.sh
#  Function: Auto capture kernel,android log  
#  Copyright (c) 2016,All rights reserved.
#  Author   Welling Yao
#  Version  0.4
#
#  Enable feature : 
#    setprop persist.corelog.enable 1
#
#  Disalbe feature :
#    setprop persist.corelog.enable 0  
#
#  Dump log :
#    adb pull /sdcard/ctflog
#
#  NOTE:
#    User should clean the flag of persist.corelog.enable before ship out


_DEBUG=OFF
LOG_DBG_PATH="/sdcard/corelog.log"

LOGTOPPATH="/sdcard/ctflog"
LOGPATH="/sdcard/ctflog/log"
LOGCAT="$LOGPATH/logcat.txt"
LOGCAT_RADIO="$LOGPATH/logcat_radio.txt"
LOGCAT_EVENT="$LOGPATH/logcat_event.txt"
LOGDMESG="$LOGPATH/dmesg.txt"
LOGKMSG="$LOGPATH/kmsg.txt"

LOGSY

你可能感兴趣的:(android系统,系统日志,SD卡)