안드로이드 시스템 로그 확인 - andeuloideu siseutem logeu hwag-in

adb logcat 명령어로 로그 출력 방법을 소개합니다.

로그 출력

로그를 출력하는 명령어는 adb logcat입니다.

로그캣의 system log 버퍼와 main log 버퍼에 있는 로그들을 모두 출력합니다.

여기서 출력되는 로그는, 로그 레벨 VERBOS를 제외한 DEBUG, INFO, WARNING, ERROR, FATAL 등의 로그를 출력합니다.

$ adb logcat

06-24 21:21:49.412  5258  5258 D NetworkSecurityConfig: No Network Security Config specified, using platform default
06-24 21:21:49.426  5162  5239 I LogSaver: LogSaver new instance with filename: carrier_services
06-24 21:21:49.440   271  4782 W android.hardware.audio.service.ranchu: TinyalsaSink::write:125 pcm_write was late reading frames, dropping 22131 us of audio
...

로그 레벨의 우선순위는 다음을 참고하세요.

  • V: Verbose (lowest priority)
  • D: Debug
  • I: Info
  • W: Warning
  • E: Error
  • F: Fatal
  • S: Silent (highest priority)

특정 태그의 로그만 출력

-s TAG를 입력하면, 설정된 TAG의 로그만 출력합니다.

$ adb logcat -s ActivityManager

06-24 21:22:00.046   502   533 W ActivityManager: Slow operation: 78ms so far, now at startProcess: done updating pids map
06-24 21:22:00.941   502  1600 I ActivityManager: Killing 4176:com.android.dialer/u0a99 (adj 985): empty for 3218s
06-24 21:22:01.041   502  1650 W ActivityManager: Unable to start service Intent { act=com.android.vending.contentfilters.IContentFiltersService.BIND pkg=com.android.vending } U=0: not found

특정 레벨 이상의 로그만 출력

명령어 뒤에 *:W를 붙여주면 Warning 로그 레벨 이상의 로그들만 출력합니다. 즉, Warning, Error, Fatal, Silent를 출력합니다.

$ adb logcat *:W

06-24 21:23:49.094  5891  5891 W d.process.acor: Unexpected CPU variant for X86 using defaults: x86
06-24 21:24:11.296   502   647 E ClipboardService: Denying clipboard access to com.android.chrome, application is not in focus nor is it a system service for user 0
06-23 22:56:09.422     0     0 W healthd : battery l=100 v=5000 t=25.0 h=2 st=4 c=900000 fc=300000 cc=10 chg=
06-24 21:24:28.293   475   475 E netmgr  : qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
...

아래 명령어는 Error 이상의 로그만 출력합니다.

$ adb logcat *:E

06-24 21:28:28.966   479   479 E wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
06-24 21:29:28.410   475   475 E netmgr  : qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
06-24 21:29:28.410   475   475 E netmgr  : Failed to open QEMU pipe 'qemud:network': Invalid argument
...

이벤트 로그 출력

adb logcat 명령어는 기본적으로 main, system 버퍼 로그만 출력하고, event 버퍼의 로그는 출력하지 않습니다.

-b events를 입력하시면 이벤트 로그를 출력합니다.

$ adb logcat -b events

06-24 21:29:32.781   908   908 I service_manager_stats: [100,62,460262]
06-24 21:30:42.169   502   531 I am_pss  : [4874,10124,com.android.chrome:privileged_process0,26935296,10887168,0,147382272,0,12,5]
06-24 21:30:59.260   502   531 I device_idle_light_step:
...

Main, System, Event 로그 모두 출력

-b all은 모든 버퍼의 로그를 출력합니다.

로그 버퍼 삭제

다음 명령어는 현재 저장된 로그 버퍼를 모두 삭제합니다. 이전 시간에 저장된 로그가 출력되지 않도록 만들 때 사용합니다.

가장 최근 로그만 출력

최근 로그에서 -t number에 입력된 줄 수만 출력합니다.

아래 명령어는 최근 로그 10줄만 출력합니다.

$ adb logcat -t 10

--------- beginning of main
06-24 21:34:29.193   479   479 E wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
06-24 21:34:29.193   479   479 E wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
06-24 21:35:28.585   475   475 E netmgr  : qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
06-24 21:35:28.586   475   475 E netmgr  : Failed to open QEMU pipe 'qemud:network': Invalid argument
06-24 21:35:29.210   479   479 E wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
06-24 21:35:29.210   479   479 E wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
06-24 21:36:28.595   475   475 E netmgr  : qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
06-24 21:36:28.596   475   475 E netmgr  : Failed to open QEMU pipe 'qemud:network': Invalid argument
06-24 21:36:29.227   479   479 E wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
06-24 21:36:29.227   479   479 E wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe

  • Android 13, AOSP 오픈소스 다운로드 및 빌드
  • Android 13 - 세분화된 미디어 파일 권한
  • Android 13에서 Notification 권한 요청, 알림 띄우기
  • Android 13에서 'Access blocked: ComponentInfo' 에러 해결
  • 에러 해결: android gradle plugin requires java 11 to run. you are currently using java 1.8.
  • 안드로이드 - 코루틴과 Retrofit으로 비동기 통신 예제
  • 안드로이드 - 코루틴으로 URL 이미지 불러오기
  • Android - 진동, Vibrator, VibrationEffect 예제
  • Some problems were found with the configuration of task 에러 수정
  • Query method parameters should either be a type that can be converted into a database column or a List
  • 우분투에서 Android 12 오픈소스 다운로드 및 빌드
  • Android - ViewModel을 생성하는 방법
  • Android - Transformations.map(), switchMap() 차이점
  • Android - Transformations.distinctUntilChanged() 소개
  • Android - TabLayout 구현 방법 (+ ViewPager2)
  • Android - 휴대폰 전화번호 가져오는 방법
  • Android 12 - Splash Screens 알아보기
  • Android 12 - Incremental Install (Play as you Download) 소개
  • Android - adb 명령어로 bugreport 로그 파일 추출
  • Android - adb 명령어로 App 데이터 삭제
  • Android - adb 명령어로 앱 비활성화, 활성화

codechachaCopyright ©2019 codechacha