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

App crashed but logCat still running

有谁知道为什么 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

Logcat 是 system 范围,它报告 Android 内发生的一切。这允许您诊断可能影响您的应用程序的外部因素(以及在它之前和之后发生的事件 运行)

来自docs

The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command. You can use logcat from an ADB shell to view the log messages.

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

如果您只希望 logcat 用于您的应用程序,请在过滤器中添加包名称,然后您将只能看到您的应用程序的 logcat。

在 Eclipse 中添加过滤器:

  1. 打开你的logcat
  2. 点击绿色“+”按钮
  3. 然后会出现下面的对话框。
  4. 添加您的应用程序包名称。

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