应用程序崩溃但logCat仍在运行

时间:2015-11-27 05:05:27

标签: android android-studio logcat android-logcat

有人知道为什么logCat会继续运行,即使应用程序崩溃了吗?

11-27 13:00:37.521    5893-5893/? I/dumpstate﹕ done
11-27 13:00:37.526    6064-6064/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
11-27 13:00:37.541    6055-6055/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
11-27 13:00:37.551    5992-5992/? D/AndroidRuntime﹕ Shutting down VM
11-27 13:00:37.556    5992-6029/? D/dalvikvm﹕ GC_CONCURRENT freed 99K, 13% free 717K/820K, paused 0ms+0ms, total 3ms
11-27 13:00:37.596    6078-6078/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
11-27 13:00:37.596    6078-6078/? E/android.os.Debug﹕ failed to load memtrack module: -2
11-27 13:00:37.601   2663-20947/? D/KeyguardUpdateMonitor﹕ sendKeyguardVisibilityChanged(true)
11-27 13:00:37.601    2663-2663/? D/KeyguardUpdateMonitor﹕ handleKeyguardVisibilityChanged(1)
11-27 13:00:37.601    6055-6055/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
11-27 13:00:37.621   2663-15938/? D/KeyguardUpdateMonitor﹕ sendKeyguardVisibilityChanged(true)
11-27 13:00:37.621    2663-2663/? D/KeyguardUpdateMonitor﹕ handleKeyguardVisibilityChanged(1)
11-27 13:00:37.626    6078-6078/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
11-27 13:00:37.671    5979-5979/? D/AndroidRuntime﹕ Shutting down VM
11-27 13:00:37.671    5979-6045/? D/dalvikvm﹕ GC_CONCURRENT freed 99K, 13% free 717K/820K, paused 1ms+0ms, total 3ms
11-27 13:00:37.686    6078-6078/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
11-27 13:00:37.691    6114-6114/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
11-27 13:00:37.691    6114-6114/? E/android.os.Debug﹕ failed to load memtrack module: -2
11-27 13:00:37.716    6114-6114/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
11-27 13:00:37.751    6018-6018/? D/AndroidRuntime﹕ Shutting down VM
11-27 13:00:37.751    6018-6066/? D/dalvikvm﹕ GC_CONCURRENT freed 99K, 13% free 717K/820K, paused 0ms+0ms, total 2ms
11-27 13:00:37.776    6114-6114/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
11-27 13:00:37.791    6010-6010/? D/AndroidRuntime﹕ Shutting down VM

这些是logCat

中显示的红色字样
11-27 13:01:36.301    2663-2663/? E/EnterpriseContainerManager﹕ ContainerPolicy Service is not yet ready!!!
11-27 13:01:36.296    2663-2663/? E/KeyguardHostView﹕ KeyguardHostView()
11-27 13:04:34.966    2441-2762/? E/Watchdog﹕ !@Sync 5375
11-27 13:07:46.711    6556-6556/? E/memtrack﹕ Couldn't load memtrack module     (No such file or directory)
11-27 13:07:46.711    6556-6556/? E/android.os.Debug﹕ failed to load memtrack module: -2

2 个答案:

答案 0 :(得分:2)

Logcat 系统范围广泛,它会报告Android内部发生的所有事情。这允许您诊断可能影响您的应用程序的外部因素(以及运行之前和之后发生的事件)

来自docs

  

Android日志记录系统提供了一种收集和查看系统调试输出的机制。来自各种应用程序和系统部分的日志收集在一系列循环缓冲区中,然后可以通过logcat命令查看和过滤。您可以使用ADB shell中的logcat来查看日志消息。

答案 1 :(得分:2)

根据 matthewrdev logcat报告您的Android设备中发生的所有事情。

如果您只想为您的应用程序使用logcat,那么在过滤器中添加包名称,那么您将只能看到应用程序的logcat。

在Eclipse中添加过滤器:

  1. 打开logcat
  2. 点击绿色“+”按钮
  3. 然后会显示以下对话框。
  4. 添加您的应用程序包名称。
  5. enter image description here

    现在,您将只能看到应用程序的logcat。