안드로이드 개발을 하다보면 단말기의 Bluetooth Log 를 확인해야하는 경우가 발생
해당 내용을 간략하게 공유함
아래 스샷처럼 [개발자 옵션] -> [블루투스 HCI 스누프 로그 사용] 을 사용으로 변경해주면 된다.
로그 사용을 켰다면 블루투스를 한번 껐다 켜주는게 좋다
그리고 시험하려는 단말기와 블루투스 통신을 진행한 뒤 .....
이제 로그를 추출해야함
1. 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 를 클릭한다 보통 화면 우측 하단에 존재함
6. 버그리포트는 bugreports 라는 폴더에 존재함
7. 해당 파일 우클릭 -> Save As 로 내 PC로 저장하면 됨. 그리고 압축 해제!!
8. FS/data/log/bt 에 btsnoop_hci.log 파일이 존재 확인
9. 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
10. 로그 분석 시작 ㅎㅎ 수고하세요 ㅎㅎ
'개발 정보 공유 > Android' 카테고리의 다른 글
안드로이드 BadTokenException 처리 (0) | 2021.12.06 |
---|---|
안드로이드 파일 복사/이동 하기 (28) | 2021.12.03 |
안드로이드 API 29 이상 listFiles 호출 시 Null 발생 및 MediaStore 이용해서 파일 이동(내부, 외부 파일 경로) (7) | 2021.12.01 |
안드로이드 HTTP 요청 후 응답 처리 (21) | 2021.11.22 |
안드로이드 메세지(Message) 처리방식 (0) | 2021.09.13 |