https://developer.android.com/studio/debug/am-logcat?hl=ko
안드로이드 공식 문서 참고
로그 보기 & 찍기
$ adb shell logcat
$ adb shell logcat | grep {찾을 단어}
안드로이드에서 로그 스택 쌓기
Log.d("log##", "#### --------------------------------- #### log stack");
(new Throwable()).printStackTrace();
안드로이드 스튜디오에서 로그 코드 작성하고 Shell에서 보기
Log.i("log##","icon id "+Integer.toString(getUserInfo().id));
$ adb logcat | grep "log##" // 에뮬 실행 후 터미널에 로그캣을 찍어보면 로그를 보여줍니다.
log (로그) 종류
Log.e(String, String) -> 오류
Log.w(String, String) -> 경고
Log.i(String, String) -> 정보
Log.d(String, String) -> 디버그
Log.v(String, String) -> 상세
'Android' 카테고리의 다른 글
Android FCM 알림 샘플앱 개발가이드 (0) | 2023.08.13 |
---|---|
안드로이드 개발하면서 참고했던 글 모음(2019~2021) (0) | 2023.08.13 |
[Android] 화면 터치 좌표값 얻기, 파일 입출력 (0) | 2022.09.06 |
[Android] 안드로이드 저장소, Scoped Storage (0) | 2022.09.06 |
[Android] UI Automator란, 사용법 (0) | 2022.08.31 |