我正在通过使用 ADB 命令查找不同状态(状态缓冲、状态播放等)来对 youtube 进行 QoE 分析。以下命令显示了 youtube 视频播放的状态。
adb shell dumpsys media_session | grep "state=PlaybackState"
但是上面命令的问题是它给出了没有时间戳的输出日志。但我需要时间戳进行数据分析。然后我找到了一个打印时间和状态状态的解决方案。
printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line";
两个命令的组合结果输出如下:
state=PlaybackState {state=7,position=-1,buffered position=0,speed=1.0,updated=533687,actions=0,custom actions=[],active item id=-1,error=Bluetooth audio disconnected}
state=PlaybackState {state=0,position=0,updated=1243174,actions=8192,error=null}
[2021-06-24 15:38:48]
但我的要求是打印时间和毫秒(15:38:48.078 那样)。我该怎么做?