Android: How to get the log of an app like when debugging in Android Studio?
<p>I am currently writing a simple app to practice Android programming. The app has a UI to which EditText elements are added during runtime. It saves and restores their content in the life cycle methods.</p>

<p>However, recently the contents were not restored as intended. So I added Log.d() invocations to find out why. As the issue occurs rarely and not during debugging I want to get the logs from my device.</p>

<p>First, I assumed I could get a logfile that was created for my Application. But apparently the logs of all apps are stored in some buffer which you can <a href="https://stackoverflow.com/questions/2882253/how-do-i-get-the-logfile-from-an-android-device">read out with logcat</a>.</p>

<p>That seems to give me an endless stream of all apps' logs. I want to get only my app's debug logs and only those with my self defined tag like when I debug my app in Android Studio:</p>

<p><img src="https://i.stack.imgur.com/uAwNU.png" alt="Viewing Logs in Android Studio (Screenshot)"></p>

<p>Can I somehow get the logs from my device and view them with the Android Studio logcat view?</p>

<p>Thanks in advance!</p>