-1
我想为Android 5.0创建一个日志文件。我使用的是没有过滤器的logcat,它仍然只显示我的应用程序的日志而不是所有的应用程序。它应该显示我Android系统的完整日志。我想使用logcat为Android 5.0创建日志文件
File root = new File(Environment.getExternalStorageDirectory(), "Logs");
// if external memory exists and folder with name Notes
if (!root.exists()) {
root.mkdirs(); // this will create folder.
}
file = new File(root, "log.txt"); // file path to save
Process process = Runtime.getRuntime().exec("logcat -f "+file.getAbsolutePath());