16
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アプリがクラッシュした時にlogcatが一瞬で消えてしまうときの対処法

Last updated at Posted at 2017-05-27

環境

Android Studio 2.3 (で確認したというだけで、他でも同じかと思います)

現象

何らかの原因でアプリがクラッシュした時に、通常はクラッシュを引き起こした例外のスタックトレースが Android Monitor の logcat に表示されるため、より詳細な情報を得られたり例外を引き起こしたコードに直接ジャンプしたるすることができる。
しかし、稀にスタックトレースが logcat に表示された直後に logcat がリフレッシュされ、スタックトレースを確認できないことがある。

原因

これは、 Android Studio の logcat の filter の設定が Show only selected application になっているためである。
この設定は選択されているプロセスのログのみを表示するということを意味するため、アプリがクラッシュして別のプロセスに選択状態が移ると、クラッシュしたプロセスのログが表示されなくなってしまう。

対処法

filter の設定を一時的に No Filter にして全てのログを表示するか、 Edit Filter Configuration で自身のアプリのパッケージ名に一致するログのみを表示するフィルタを作成して使用するとよい。

No Filter

Custom Filter Configuration

参照: https://stackoverflow.com/a/31040015

16
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?