主要是因为你的app在短时间内输出太多次的日志,导致日志丢失

 As soon as app considered 'chatty' by logcat (more than 5 lines per second), logs of your app will be collapsed.

You can avoid this behaviour by whitelisting your app for logcat:

adb logcat -P '<pid or uid of your app>'

You can print the current white and black lists by executing:

adb logcat -p

Also this command is helpful to print logcat statistics:

adb logcat -S

Additionally, I found useful to auto-whitelist my app for logcat directly from code during tests:

int pid = android.os.Process.myPid();
String whiteList = "logcat -P '" + pid + "'";
Runtime.getRuntime().exec(whiteList).waitFor();
More info can be found in official docs for logcat here

 

相关文章:

  • 2021-10-14
  • 2021-07-22
  • 2022-02-27
  • 2021-09-09
  • 2021-10-20
  • 2022-01-06
  • 2021-07-26
  • 2021-08-04
猜你喜欢
  • 2022-01-19
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
相关资源
相似解决方案