반응형

안드로이드 개발을 하다보면 단말기의 Bluetooth Log 를 확인해야하는 경우가 발생

 

해당 내용을 간략하게 공유함

 

아래 스샷처럼 [개발자 옵션] -> [블루투스 HCI 스누프 로그 사용] 을 사용으로 변경해주면 된다.

참고. 개발자 모드 스크린샷

로그 사용을 켰다면 블루투스를 한번 껐다 켜주는게 좋다

 

그리고 시험하려는 단말기와 블루투스 통신을 진행한 뒤 .....

 

이제 로그를 추출해야함

SMALL

 

1. Android Studio 를 실행!!

   [Android Studio 다운로드]

 

Download Android Studio and SDK tools  |  Android Developers

<!-- hide description -->

developer.android.com

2. 폰을 USB 연결!!

3. CMD 창에서 ADB.exe 가 있는 곳으로 이동

cd C:\Users\USER\AppData\Local\Android\Sdk\platform-tools
C:\Users\USER\AppData\Local\Android\Sdk\platform-tools>adb bugreport test.zip
/data/user_de/0/com.android.shell/files/bugreports/bugreport-2021-11-18-14-27-54.zip: 1 file pulled, 0 skipped. 24.9 MB/s (9181748 bytes in 0.351s)
Bug report copied to test.zip

4. 3번에서 adb bugreport test.zip 을 입력하면 전체 버그 리포트가 추출된다

5. Android Studio 에서 File Explorer 를 클릭한다 보통 화면 우측 하단에 존재함

참고. 화면 우측 하단 File Explorer 위치

반응형

6. 버그리포트는 bugreports 라는 폴더에 존재함

참고. bugreport 파일 위치

7. 해당 파일 우클릭 -> Save As 로 내 PC로 저장하면 됨. 그리고 압축 해제!! 

8. FS/data/log/bt 에 btsnoop_hci.log 파일이 존재 확인

9. Wireshark 라는 프로그램으로 해당 파일을 열면 완료!!

  [Wireshark 다운로드]

 

Wireshark · Download

Download Wireshark The current stable release of Wireshark is 3.4.10. It supersedes all previous releases. You can also download the latest development release (3.6.0rc3) and documentation.

www.wireshark.org

참고. Wireshark 로 btsnoop_hci.log 검색

10. 로그 분석 시작 ㅎㅎ 수고하세요 ㅎㅎ 

반응형

+ Recent posts