From 7781000d1abc31bad57521b36d7a5e1ef76cbe4f Mon Sep 17 00:00:00 2001 From: jessikitty Date: Wed, 1 Jul 2026 21:22:43 +1000 Subject: [PATCH] Add ADB BT log puller script --- pull_bt_log.bat | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pull_bt_log.bat diff --git a/pull_bt_log.bat b/pull_bt_log.bat new file mode 100644 index 0000000..6b6fa8a --- /dev/null +++ b/pull_bt_log.bat @@ -0,0 +1,61 @@ +@echo off +:: pull_bt_log.bat - Pull Bluetooth HCI snoop log from Oppo CPH2591 +:: Run from anywhere — requires adb in PATH or D:\platform-tools + +echo ============================================ +echo KAIYU BLE - Pull HCI Snoop Log +echo ============================================ +echo. + +where adb >nul 2>&1 +if errorlevel 1 ( + if exist "D:\platform-tools\adb.exe" ( + set PATH=%PATH%;D:\platform-tools + ) else ( + echo [ERROR] adb not found. Add D:\platform-tools to PATH. + pause & exit /b 1 + ) +) + +echo Checking device... +adb devices +echo. + +echo [1/3] Trying direct copy... +adb shell "cp /data/misc/bluetooth/logs/btsnoop_hci.log /sdcard/btsnoop_hci.log" 2>nul +if not errorlevel 1 goto :pull + +echo [2/3] Trying backup path... +adb shell "cp /data/misc/bluetooth/logs/btsnoop_hci.log.bak /sdcard/btsnoop_hci.log" 2>nul +if not errorlevel 1 goto :pull + +echo [3/3] Trying via run-as... +adb shell "run-as com.qunyu.kaiyu cp /data/misc/bluetooth/logs/btsnoop_hci.log /sdcard/btsnoop_hci.log" 2>nul +if not errorlevel 1 goto :pull + +echo. +echo [!] Could not pull log directly. +echo. +echo Make sure you have: +echo 1. Developer Options - Bluetooth HCI Snoop Log = ON +echo 2. Toggled Bluetooth OFF then ON after enabling +echo 3. Used the KAIYU app to send On/Off/colour commands +echo 4. Then run this script +echo. +goto :end + +:pull +echo Pulling file... +adb pull /sdcard/btsnoop_hci.log D:\Claude\bugreport\btsnoop_hci.log +adb shell "rm /sdcard/btsnoop_hci.log" 2>nul +echo. +echo ============================================ +echo SUCCESS: D:\Claude\bugreport\btsnoop_hci.log +echo ============================================ +echo. +echo Now run: +echo python D:\Claude\HH-BT-Controller\sniffer\parse_hci.py +echo. + +:end +pause