[请教]Android Logcat 初始时间不准确?
时间: 2020-08-18来源:V2EX
前景提要
需求: 1:保存安卓平台的应用 log(应用都使用了标准的 log 接口),kernel log 到 机子内部的某块区域(emc)
做法: 1:某个 App,执行 shell 命令 logcat *:D -b all > logcatPath
问题: 1:发现所有 log 的开始时间都是不正确的
第一行 log
--------- beginning of kernel
09-26 23:23:04.755 0 0 I : Booting Linux on physical CPU 0x0
.....
09-26 23:23:18.881 0 0 I sdcardfs: options - mask:18
06-09 18:57:04.003 1746 1746 I SystemServer: InitWatchdog ....
正确时间更新的临近两行
06-09 18:57:05.666 1468 1468 W DisplaySettingTime: SetTimeService GetSysTime: year: 2020, month: 6, day: 9, hour: 18, min: 57, sec: 5
06-01 00:00:19.000 1468 1468 E DisplaySettingTime: SetTimeService SetTimeToKernal:: settimeofday success year 2020, month 6, day 1, hour 0, minute 0, second 19
之后的时间就是正常的了。(正常时间应该为 6.1 号) ◆◆! 请问如何让开机的时间 正常 或者 从 00-00 00:00:00.000 开始,而不是一个随机的时间???
类似问题: https://stackoverflow.com/questions/12359221/logcat-has-logs-with-timestamps-out-of-sequence
其他被 pass 的方案: 使用 cat /proc/kmsg //( App 没有 root 权限) 使用 demsg > logcatPath //(dmesg 读完之后会停止,无法一直读取新的 log)
请大家多多指教,万分谢谢。

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行