Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Logcat - "Show only selected application"

I'm trying to use LogCat in Android Studio 2.2.2 in some debugging but my Logcat runs like a firehose and and there's too much content to see.

In Android Monitor when the LogCat tab is selected there's a dropdown where one of the choices is "Show only selected application" so I selected that but it didn't seem to have any effect. My LogCat runs like a firehose even when I'm disconnected from my debug target. So what does "Show only selected application" do and how can I tell what the "selected application" is?

like image 217
user316117 Avatar asked Nov 17 '16 17:11

user316117


People also ask

What is verbose in Android Logcat?

Verbose: Show all log messages (the default). Debug: Show debug log messages that are useful during development only, as well as the message levels lower in this list. Info: Show expected log messages for regular usage, as well as the message levels lower in this list.

What is PID in Logcat?

pid = process ID. uid = user ID of the application that owns that process. gid = group IDs of the application that owns that process.

How do I find application logs on Android?

Navigate to device settings and enable Developer Options (see section for ADB logs) Navigate to Developer Options and tap on Take/Submit Bug Report. Select Full Report when prompted to get the full device info along with the logs.


2 Answers

The following works on Android Studio 3.4: Use the Logcat filter dropdown at the top right of the Logcat panel. Select "Edit Filter Configuration".

  • Enter your package name in the "Package Name" field.
  • Enter something meaningful to you in the "Filter Name" field (I used my package name again).

Your new filter will now appear in the Logcat filter dropdown, and when selected will show only messages from your package.

Example filter configuration

like image 176
AngusTS Avatar answered Sep 28 '22 06:09

AngusTS


Set tag for every log and then filter logs for that specific tag

Log.d("TAG","Application logs");

Edit Filter configuration and add your tag. Then you will only see your application logs

enter image description here

Happy Coding!!

like image 24
Sahil Mahajan Avatar answered Sep 28 '22 07:09

Sahil Mahajan