title: How to save LogCat contents to internal memory of a file?
body: <p>I have implemented a solution</p>
  <pre><code>try {
              var process = Runtime.getRuntime().exec(&quot;logcat ${BuildConfig.APPLICATION_ID}:V *:S&quot;)
              process = Runtime.getRuntime().exec(&quot;logcat -f &quot; + &quot;/storage/emulated/0/&quot;+&quot;Logging.txt&quot;)
          } catch (e: Exception) {
              e.printStackTrace()
          }
  </code></pre>
  <p>Do we need to run this command only once or multiple times, as on Android 11 Chromebook it is working fine when run once, and on Android 10 Tablet it stops writing to file when run once, when i run it again then it writes to the same file</p>