您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Andorid logcat
相关文章推荐