How to generate printed messages in Android Studio debugging?

Question!

I am currently attempting to debug an Android App in Android Studio. However, because of the thousands of unhelpful messages on the logcat system, I am finding it impossible to work with this.

Does anyone know how I can simply insert an equivalent of System.out.println statements into my code so that I can view only these whilst I am debugging my code, instead of all the other random system messages that logcat generates?

Thanks in advance for any help.



Answers

Using logcat is the way of doing whate you want. System.out.println will not do the job.

In android studio you can filter the log via the spinner on the top right of the logging window. If you select "Show only selected application" and select your app in the spinner on the top left of the window you will only see logs for your app.

You can also use in your shell. If you want to see only logs for a certain tag, you can use (assuming adb is in your path) adb logcat | grep your_tag

By : sonic


If you want to see only your custom messages then it is matter of filtering out remaining messages which can be done using tags. This is already described here: How to filter Android logcat by application?



This video can help you solving your question :)
By: admin