Repository navigation
Expand file tree
/
Copy pathrun.bat
More file actions
64 lines (56 loc) · 1.41 KB
/
Copy pathrun.bat
File metadata and controls
64 lines (56 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@echo off
REM Flutter Clean + Pub Get + Run Script
REM Usage: run.bat [device-id]
cd /d "%~dp0"
if "%1"=="" (
set DEVICE=127.0.0.1:5555
) else (
set DEVICE=%1
)
echo.
echo ========================================
echo Flutter Syathiby - Clean, Get, Run
echo ========================================
echo Device: %DEVICE%
echo.
REM Step 1: Clean
echo [1/4] Running: fvm flutter clean
call fvm flutter clean
if %errorlevel% neq 0 (
echo Error during clean!
exit /b 1
)
REM Step 2: Get dependencies
echo.
echo [2/4] Running: fvm flutter pub get
call fvm flutter pub get
if %errorlevel% neq 0 (
echo Error during pub get!
exit /b 1
)
REM Step 3: Create junction if not exists
echo.
echo [3/4] Setting up build path junction...
if not exist "build\app" mkdir "build\app"
if exist "build\app\outputs" (
echo Removing old junction...
rmdir /s /q "build\app\outputs" >nul 2>&1
)
mklink /J "build\app\outputs" "%cd%\android\app\build\outputs" >nul
if exist "build\app\outputs" (
echo Junction created successfully!
) else (
echo Warning: Junction creation failed!
)
REM Step 4: Run app
echo.
echo [4/4] Running: fvm flutter run -d %DEVICE% --dart-define=FLAVOR=local
call fvm flutter run -d %DEVICE% --dart-define=FLAVOR=local
if %errorlevel% neq 0 (
echo Run failed!
exit /b 1
)
echo.
echo ========================================
echo SUCCESS!
echo ========================================