Files
wushu/wifi_device_helper.bat
2026-04-09 02:23:27 +08:00

70 lines
2.2 KiB
Batchfile

@echo off
REM Flutter WiFi Device Connection Helper
REM Helps connect and debug Flutter apps on WiFi-connected Android devices
echo ========================================
echo Flutter WiFi Device Connection Helper
echo ========================================
echo.
REM Check if device is connected
echo Checking connected devices...
flutter devices
echo.
echo ========================================
echo Available Actions:
echo ========================================
echo 1. Run on WiFi Device (SM T970 - 192.168.50.213:44263)
echo 2. Run on USB Device (PKB110 - S48DTKPRVK4H8PKB)
echo 3. Build APK only
echo 4. Install APK to WiFi Device
echo 5. Check device connection status
echo 6. Exit
echo ========================================
set /p choice="Enter your choice (1-6): "
if "%choice%"=="1" (
echo.
echo Running on WiFi Device with extended timeout...
flutter run --device-id=192.168.50.213:44263 --device-timeout=120 --device-connection=wireless
) else if "%choice%"=="2" (
echo.
echo Running on USB Device...
flutter run --device-id=S48DTKPRVK4H8PKB --device-timeout=30 --device-connection=attached
) else if "%choice%"=="3" (
echo.
echo Building APK...
flutter build apk --debug
) else if "%choice%"=="4" (
echo.
echo Installing APK to WiFi Device...
if exist "build\app\outputs\flutter-apk\app-debug.apk" (
"E:\sdk\android\platform-tools\adb.exe" -s 192.168.50.213:44263 install -r "build\app\outputs\flutter-apk\app-debug.apk"
echo.
echo APK installed successfully!
echo Launching app...
"E:\sdk\android\platform-tools\adb.exe" -s 192.168.50.213:44263 shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER app.wushu.poes/app.wushu.poes.MainActivity
) else (
echo APK not found. Please build it first (option 3).
)
) else if "%choice%"=="5" (
echo.
echo Checking device connection status...
echo.
echo ADB Devices:
"E:\sdk\android\platform-tools\adb.exe" devices
echo.
echo Flutter Devices:
flutter devices
) else if "%choice%"=="6" (
echo.
echo Exiting...
exit /b
) else (
echo Invalid choice. Please try again.
)
echo.
pause