logcat

Android Q 持久化logcat日志

时光毁灭记忆、已成空白 提交于 2019-12-11 07:02:28
一.背景: Android开发经常遇到一个问题,测试提供的日志没有抓到问题发生点的日志,也就是问题发生时的日志被设备最新的日志冲刷掉了 二.解决思路: 在和谷歌的沟通过程中,谷歌在日志系统中明确要求合作伙伴的开发人员提供bugreport.zip。在这个压缩包中,解压后的bugreport-你的设备名称-2019-11-26-11-19-49.zip\FS\data\misc\logd中会持久化的保存logcat日志(最多255个) 那么顺着谷歌的思路,很容易联想到adb shell进入设备命令行,查看data\misc\logd目录下的文件 接下来在opengrok中搜索“data/misc/logd”很容易就能搜索到logd相关的文件。 介绍logd配置的文件是:system/core/logcat/logpersist和system/core/logd/README.property,两个文件很容易看懂意思,简单来说就是通过build.prop配置属性,然后开启logd服务,保存logcat日志 三.解决方案 在device/设备厂商/xxx.mk下,配置如下内容即可使上述功能生效: ifeq ($(TARGET_BUILD_VARIANT),userdebug) PRODUCT_DEFAULT_PROPERTY_OVERRIDES+= \ persist.logd

How to programmatically read logcat in real time?

隐身守侯 提交于 2019-12-11 04:45:38
问题 I have a service that would like to read data from logcat, from the start of the service (i.e. discarding logcat data prior to service start), monitoring the logcat data in real time, filtering the logcat to only show tags of "ActivityManager" and informational logs. I would then like to perform certain actions based on the filtered logcat data. I tried the following, but it doesn't work: Runtime.getRuntime().exec("logcat -c"); // flush the logcat first Process process = Runtime.getRuntime()

Gems App - Live Stream Fragment

最后都变了- 提交于 2019-12-11 02:49:20
问题 While developing a Gems app with the help of Fragments,logcat error occurred at runtime. LogCat: E/AndroidRuntime(667): FATAL EXCEPTION: main E/AndroidRuntime(667): java.lang.NullPointerException E/AndroidRuntime(667): at com.sit.gems.frgment.HomeBaseFragment.onMoreFragmentOptionSelected(HomeBaseFragment.java:345) E/AndroidRuntime(667): at com.sit.gems.activity.HomeActivity.onMoreFragmentOptionSelected(HomeActivity.java:80) E/AndroidRuntime(667): at com.sit.gems.frgment.MoreFragment$1

Can't get LogCat (Alcatel OneTouch Evolve)

北战南征 提交于 2019-12-11 02:18:28
问题 I've been trying to debug an application using my Alcatel OneTouch Evolve running "Firmware Version 4.1.2" (I guess that's Android Jellybean 4.1.2) but I get an empty logcat, and I'm using Android Studio 1.2.2. Debugging works just fine with another device (Samsung Exhibit 4G 2 running CyanogenMod 12.1 -- Lollipop), but it's excruciatingly slow. This suggests that my computer's setup is fine for debugging but that something is wrong with the Alcatel OneTouch's settings. Has anyone else seen

Logcat continously shows messages

牧云@^-^@ 提交于 2019-12-11 02:13:57
问题 I don't know what's wrong. My logcat has been troubling me for two days. When device is connected to test, the logcat continuously gives messages though I don't run my app. If I run my app, I am unable to find my app logs in such a huge amount of data. Can someone suggest me to avoid this and so that I can only view my application's logs? Below is the logcat's flow which continously flows. I am testing with htc. 04-09 09:27:10.007: D/dalvikvm(843): GC_EXPLICIT freed 128K, 43% free 3530K/6151K

LogCat: Unable to open log device

拟墨画扇 提交于 2019-12-11 00:23:17
问题 My Phone: Samsung Galaxy Note N7000 Kernel: HyDraCore_v6.2_B3_R3P0 Build: MIUI-2.10.19 RocketMIUI v8 I read many threads about that but nothing solved my problem... When I connect my phone to my computer and run the project wirh "Run As -> Android Application" the program starts on my phone but the logcat is empty in eclipse :-/ In logcat I only receive this one message: Unable to open log device '/dev/log/main': No such file or directory What do I have to do to get it worked?? 回答1: I'm using

App doesn't show firebase notifications (broadcast intent callback: result=CANCELLED forIntent)

荒凉一梦 提交于 2019-12-10 19:21:23
问题 I can't receive my Firebase Notifications when the app is killed or in background. I signed the APK, and it doesn't work, and when I send my Data notification with JSON the logcat shows me this error: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.example.paolomazza.firebasedemo3 (has extras) } Given the following Manifest, what could be the cause of this bug? Thanks in Advance <?xml version="1.0" encoding="utf-8"?> <uses-permission

How to hide, remove, filter logs in the logcat in Eclipse for Android

社会主义新天地 提交于 2019-12-10 19:19:23
问题 I had some difficulties finding the right post for hiding logs in Eclipse for Android (maybe because of the keywords of the subject), that's why I created one. Here is the post I found : (look at ZoFreX's answer, the simplest) How to exclude certain messages by TAG name using Android adb logcat? 回答1: The filter that I have found to work the best for me is: ^(?!.*(text_to_filter_out_here)).*$ This works for anything from my experience. I have threads that run infinite loops creating a ton of

remote logcat - Android Studio

痴心易碎 提交于 2019-12-10 16:36:54
问题 Is it possible to see the logcat of an app that is on a distant device, in short, is it possible to logcat remotely? I sent an app to a client, this is giving error in your device, I tested with the emulator in the same version, but the error only occurred with it. 回答1: Is it possible to see the logcat of an app that is on a distant device, in short, is it possible to logcat remotely? It is possible to connect device over wifi to perform debugging. You can refer to this document. However, it

Debug Android App Crash - no info in logcat, no info in console when attached

两盒软妹~` 提交于 2019-12-10 16:04:24
问题 Android Studio 1.5.1 compileSdkVersion 23 Here's what's happening: App is attached to debugger. I can hit breakpoints, step through code. I have exceptions logged to the console. I'm attempting to display a dialog fragment. The layout xml loads properly, and I can access UI elements with findbyid... The question is not around the specifics of this problem, and is more around why I can't seem to find any meaningful information on the crash that occurs? I've poured over the output from adb