如何按应用程序过滤Android logcat? [英] How to filter Android logcat by application?

查看:40
本文介绍了如何按应用程序过滤Android logcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何按应用程序过滤 Android logcat 输出?我需要这个,因为当我连接设备时,由于来自其他进程的垃圾邮件,我找不到我想要的输出.

How can I filter Android logcat output by application? I need this because when I attach a device, I can't find the output I want due to spam from other processes.

推荐答案

原文如下.当一个 Android Studio 不存在时.但是如果你想过滤整个应用程序,我会使用 pidcat 进行终端查看或 Android Studio.使用 pidcat 而不是 logcat 那么标签不需要是应用程序.你可以用 pidcat com.your.application

The original is below. When one Android Studio didn't exist. But if you want to filter on your entire application I would use pidcat for terminal viewing or Android Studio. Using pidcat instead of logcat then the tags don't need to be the application. You can just call it with pidcat com.your.application

您应该使用自己的标签,请查看:http://developer.android.com/reference/android/util/Log.html

You should use your own tag, look at: http://developer.android.com/reference/android/util/Log.html

喜欢.

Log.d("AlexeysActivity","what you want to log");

然后当你想阅读日志时使用>

And then when you want to read the log use>

adb logcat -s AlexeysActivity 

这会过滤掉所有不使用相同标签的内容.

That filters out everything that doesn't use the same tag.

这篇关于如何按应用程序过滤Android logcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆