@echo off chcp 65001 >nul 2>&1 setlocal enabledelayedexpansion echo ======================================== echo Build - Install - Launch - Debug echo ======================================== echo. :: Step 1: Build Debug APK echo [1/5] Building Debug APK... call gradlew.bat assembleDebug --no-daemon if %errorlevel% neq 0 ( echo [ERROR] Build failed! pause exit /b 1 ) echo [SUCCESS] Build completed! echo. :: Step 2: Check device connection echo [2/5] Checking device connection... adb devices adb devices | find "device" | find /v "List" >nul if %errorlevel% neq 0 ( echo [ERROR] No device detected! Please connect your phone and enable USB debugging. pause exit /b 1 ) echo [SUCCESS] Device connected! echo. :: Step 3: Uninstall old version (to avoid signature conflicts) echo [3/5] Uninstalling old version (if exists)... adb uninstall com.durian.tssparty 2>nul echo Done! echo. :: Step 4: Install APK echo [4/5] Installing APK... adb install app\build\outputs\apk\debug\app-debug.apk if %errorlevel% neq 0 ( echo [ERROR] Installation failed! pause exit /b 1 ) echo [SUCCESS] Installation completed! echo. :: Step 5: Launch app echo [5/5] Launching app... adb shell am start -n com.durian.tssparty/.MainActivity if %errorlevel% neq 0 ( echo [ERROR] Launch failed! pause exit /b 1 ) echo [SUCCESS] App launched! echo. :: Clear old logs echo Clearing old logs... adb logcat -c echo. :: Show instructions echo ======================================== echo App successfully launched! echo ======================================== echo. echo Starting log monitoring... echo. echo Key log tags: echo - MainViewModel (ViewModel layer) echo - TssRepository (Repository layer) echo - GrpcClient (Network communication) echo - TssNativeBridge (TSS native library) echo - AndroidRuntime (Crash logs) echo. echo Press Ctrl+C to stop log monitoring echo. timeout /t 2 /nobreak >nul :: Start monitoring logs adb logcat -v time MainViewModel:D TssRepository:D GrpcClient:D TssNativeBridge:D AndroidRuntime:E *:S :: If user stops log monitoring echo. echo Log monitoring stopped. echo. pause