Record log while in programing
2016-09-23 02:04
274 查看
new Thread(new Runnable() { @Override public void run() { File logFile = new File("/sdcard/logcat.txt"); if(logFile.exists()) logFile.delete(); try { Process process = Runtime.getRuntime().exec("logcat -c"); // process = Runtime.getRuntime().exec("logcat -f " + logFile + " *:S MainActivity:D MyActivity2:D"); process = Runtime.getRuntime().exec("logcat -f " + logFile); } catch (IOException e) { e.printStackTrace(); } } }).start(); From:http://www.journal.deviantdev.com/android-log-logcat-to-file-while-runtime/
logcat -f /sdcard/log.log -v time -s tag
相关文章推荐
- 137 While Monitoring the space usage in your database that is in ARCHIVELOG mode you observed that t
- record drop database in sql log
- org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.hyzn.historicalRecord.dao.ITB_HISTORYLOGDAO.TB_HISTORYLOGResultMap
- How to set the sequence value while saving the record in OA Framework
- record drop database in sql log
- mysql报错:ERROR: Error in Log_event::read_log_event():"Sanity check
- 关于VMware Tools installation cannot be started manually while Easy Install is in progress.
- 关于VMware Tools installation cannot be started manually while Easy Install is in progress
- 使用Mono Cecil 动态获取运行时数据 (Atribute形式 进行注入 用于写Log) [此文报考 xxx is declared in another module and needs to be imported的解决方法]-摘自网络
- ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 438, event_type: 2
- sql server 2008 R2 Error 9003:The log scan number passed to log scan in database is not valid
- Scanner.findInLine()与while的使用莫名其妙的导致NoSuchElementException: No line found
- "Non Zero Exit Status” R 3.0.1 'XML' and 'RCurl' " in bioconductor while installing packages
- 'Could not find first log file name in binary log index file'的解决办法
- Android An unexpected exception occurred while creating a change object. see the error log for more details
- Authentication succeeded, but no customer record is found in the customer backend
- java.lang.IllegalStateException: beginBroadcast() called while already in a broadcast
- nginx error.log 提示 [error] 887#887: *58 FastCGI sent in stderr: "PHP message: PHP Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637
- ./bin/logServer: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or dir
- How to temporarily suppress infolog messages in Dynamics Ax (deux)