有时候Logcat日志过长,为了方便查看,我们可以把它存储到text文档。
String str = "hello world";
try {
FileWriter fw = new FileWriter(PATH + "/aa.txt");
fw.flush();
fw.write(str);
fw.close();
} catch (Exception e) {
e.printStackTrace();
}
String str = "hello world";
try {
FileWriter fw = new FileWriter(PATH + "/aa.txt");
fw.flush();
fw.write(str);
fw.close();
} catch (Exception e) {
e.printStackTrace();
}
本文介绍了一种简单的方法来保存Android开发中的Logcat日志到本地文本文件,便于开发者进行离线分析和调试。
410

被折叠的 条评论
为什么被折叠?



