[英]how to see the log file in android
I want a code for creating the log file in android and at the run time where to check where this log file is getting created, I also example for the same in java 我想要一个代码来在android中创建日志文件,并在运行时检查在哪里创建此日志文件,我也在Java中以相同的示例
Can we create a log file using predefined functions in android itself 我们可以使用android本身中的预定义功能创建日志文件吗
You can start your own process of logcat on the device, and redirect the output to some file. 您可以在设备上启动自己的logcat进程,然后将输出重定向到某个文件。 This is the basics ( do it on a separate thread) 这是基础(在单独的线程上执行)
Process logcat = Runtime.getRuntime().exec("logcat"); // start process
BufferedReader reader = new BufferedReader( new InputStreamReader(logcat.getInputStream())); // grab output stream
// store to file or print to screen
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.