How to constanly monitor LogCat file?

前端 未结 2 1388
独厮守ぢ
独厮守ぢ 2020-12-30 15:55

I need to somehow monitor the LogCat log, meaning that while my service is running I need to read the LogCat for new entries. At this moment I know only how to retrieve once

2条回答
  •  无人及你
    2020-12-30 16:32

    You can create a new thread to running the logcat(without the option -d) in the background.

    Note: Use the buffer events instead of the process ActivityManager, it is more accurate. "logcat -b events"

提交回复
热议问题