Add ADB BT log puller script

This commit is contained in:
2026-07-01 21:22:43 +10:00
parent 838ed38844
commit 7781000d1a
+61
View File
@@ -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