安卓往本地文件写崩溃日志

File logDirectory = new File( Environment.getExternalStorageDirectory() + "/1212播放器断播日志" );
File logFile = new File( logDirectory, "logcat" + System.currentTimeMillis() + ".txt" );

if ( !logDirectory.exists() ) {
logDirectory.mkdir();
}

try {
Process process = Runtime.getRuntime().exec( "logcat -c");
process = Runtime.getRuntime().exec( "logcat -v time -f " + logFile + " -s IJKMEDIA");
} catch ( IOException e ) {
e.printStackTrace();
}

 

 

-s IJKMEDIA为过滤tag为IJKMEDIA的日志,如果改为" *:E"则是首页所有error级别的日志,自然包括崩溃日志了

 

 

 

查看keystore签名命令:     keytool -list -v -keystore wlmqhsb.keystore

posted @ 2017-01-06 13:54  m00219907  阅读(1186)  评论(0编辑  收藏  举报