android clear log programmatically

后端 未结 2 727
感情败类
感情败类 2021-01-06 03:38

I want to get the whole log (Log.d(...)), after pressing a button to analyse some parts of our app (count something...). I\'m able to do this by the following code:

2条回答
  •  孤街浪徒
    2021-01-06 04:24

    This code has worked for me correctly which is put into @After case

         Process process = new ProcessBuilder()
            .command("logcat", "-c")
            .redirectErrorStream(true)
            .start();
    

提交回复
热议问题