AndroidのLog Catをtxtファイルに書き込む方法ですが、すべてのログは必要ありませんが、アプリ用のものだけが必要です。私はこのコードを持っていますが、すべてを書いています
String fileName = "logcat.txt";
File root = Environment.getExternalStorageDirectory();
System.out.println("CONTEXT : " + root);
File outputFile = new File(root.getAbsolutePath(), fileName);
System.out.println("FILE : " + outputFile);
@SuppressWarnings("unused")
Process process;
try {
process = Runtime.getRuntime().exec("logcat -f "+ outputFile);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
自分だけのアプリを書くための作り方!アプリの名前は nick.app です
ありがとう