Android 개발/팁 / 활용정보
adb logcat
SiamDaArc
2011. 5. 31. 09:50
anr 로그 위치 : /data/anr/traces.txt
전체 로그 출력
adb logcat
로그발생 시간을 포함하여 로그 출력
adb logcat -v time
우선순위에 따라 로그 필터링
명령어
- adb logcat [ <filter-spec> ]
Filter 우선 순위
- Verbose < Debug < Info < Warning < Error < Fatal < Silent
- Filter는 각 우선순위의 첫 대문자로 설정한다.
- Filter 이상의 우선순위를 갖는 로그를 출력한다.
사용 예
- adb logcat *:I ==> Info 이상의 우선순위를 갖는 로그(Info, Warning, Error, Fatal, Silent)를 출력한다.
- adb logcat mytag:I *:S ==> Info 중 "mytag"문자열을 갖는 로그만 출력한다. 우선순위가 높아도 다른 로그는 출력하지 않는다.
팁: 우선순위에 관계없이 특정 문자열을 포함하는 로그를 알고 싶으면?
- adb logcat | grep mystring ==> "mystring"문자열을 갖는 로그만 출력한다.
To watch the log of an active device continually: adb logcat
To dump the whole log: adb logcat -d
To dump the whole log to a file: adb logcat -d > log.txt
To filter and display a particular log tag: adb logcat -s MyLogTag
adb logcat -d > log.txt
adb shell cat proc/kmsg > logkmsg.txt
[출처] Android LogCat의 로그를 로컬 컴퓨터 파일로 저장하기|작성자 검린