Android Studio,应用程序关闭后会清理 logcat [英] Android Studio, logcat cleans after app closes

查看:128
本文介绍了Android Studio,应用程序关闭后会清理 logcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自更新 Android Studio 1.2 Beta 以来,我的 logcat 出现问题.当我运行我的应用程序时,它会像往常一样记录所有内容,然后我的应用程序崩溃了,应用程序说:不幸的是,游戏已停止.

I'm having a problem with my logcat since update 1.2 Beta for Android Studio. When I run my app it logs everything like it normally did, then I get at the point where my app crashes with the app saying: unfortunately, Game has stopped.

几秒钟后,android 关闭该消息.当这种情况发生时,我的 logcat 也被完全清除,这意味着我几乎没有时间阅读错误.我确实找到了一些关于缓冲区的信息,但似乎 Android Studio 没有增加的选项除此之外,我怀疑这是问题所在.

After a few seconds android closes that message. When that happens my logcat also gets fully cleared meaning that I barely get anytime to read the error. I did found some info about a buffer, but it seems that Android Studio doesn't have the option to increase it besides the fact that I doubt that being the problem.

可能有用的是,在它清除并填充进程更改为 Android.process.core 之后,我在 logcat 中收到的消息是:

Something that may be useful is that after it clears and stuff the process changes to Android.process.core and the message I get in my logcat is:

04-13 10:28:13.394  12259-12265/android.process.acore D/dalvikvm﹕    
Debugger has detached; object registry had 1 entries

我确实阅读了有关断点的信息,因此在设置-构建、执行、部署-调试器中禁用了对断点的焦点应用程序,但它没有任何效果.

I did read about breakpoints, so disabled focus application on breakpoints in Settings-build, execution, deployment-debugger but it didn't have any effect.

推荐答案

我遇到了同样的问题,但看起来更像是一个功能而不是一个错误:

I had the same issue, but looks more like a feature than a bug:

在 AndroidStudio 中,Logcat 窗口的默认设置似乎是仅显示选定的应用程序"(Logcat 窗口的右上角)...它正在查看选定的日志进程(默认情况下您当前的启动).因此,当您的应用在测试过程中崩溃时,该过程就会消失,因此过滤器会清除日志.

In AndroidStudio, the default setting for the Logcat window seems to be "Show only selected Application" (top right corner of the Logcat window)... which is looking at the log of the selected process (your current launch by default). So when your app crashes during testing, that process is gone, so the filter clears the log.

改为选择编辑过滤器配置..."并为您的应用设置过滤器,例如:

  • 过滤器名称:MyApp
  • PackageName:com.example.myapp(<< 替换为您应用的包名称)

...然后选择该过滤器以供将来运行.即使在应用程序崩溃之后,这也应该为您保留日志.

...and then select that filter for future runs. This should keep the log there for you, even after the app crashes.

这篇关于Android Studio,应用程序关闭后会清理 logcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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