How to save LogCat contents to file?

前端 未结 10 1283
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 06:57

I\'ve added debug strings (using Log.d()) and want to see them in context from the contents of logCat. The \"save\" icon for LogCat has a \"Save selected items\" hint, but t

10条回答
  •  星月不相逢
    2020-12-05 07:19

    String filePath = folder.getAbsolutePath()+ "/logcat.txt"; 
    Runtime.getRuntime().exec(new String[]{"logcat", "-f", filePath, "MyAppTAG:V", "*:E"});
    

提交回复
热议问题