title: How to redirect the content in Logcat to file on android?
body: <p>Recently, I'm developing a android application. I've got a lot of <code>Log.i</code> or <code>Log.e</code> in my code. </p>
  
  <p>When I test the app on my phone, which is connected to my computer via USB, I can get all the logs under the Logcat. But when my phone not connecting to my computer, I got no idea where the bug comes from because <code>Log.*</code> doesn't write logs to file.</p>
  
  <p>Could anyone give my some suggestions on how to <strong>redirect</strong> the <code>Log.*</code> to a file with <strong>minimal change to my code</strong>? Thanks a lot!</p>
  
  <p><strong>p.s.</strong></p>
  
  <p>I've searched about how to redirect Logcat to file using <code>adb logcat</code>. Could anyone tell me how to filter the logs which are corresponding to my current app?</p>