-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-android-debug.bat
More file actions
59 lines (51 loc) · 1.14 KB
/
build-android-debug.bat
File metadata and controls
59 lines (51 loc) · 1.14 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
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
echo ========================================
echo FlashLog - Android Debug APK Build
echo ========================================
echo.
echo [1/4] Building frontend (npm run build)...
call npm run build
if errorlevel 1 (
echo.
echo ERROR: Frontend build failed.
exit /b 1
)
echo.
echo [2/4] Syncing web assets to Android (npx cap sync android)...
call npx cap sync android
if errorlevel 1 (
echo.
echo ERROR: Capacitor sync failed.
exit /b 1
)
echo.
echo [3/4] Entering android directory...
cd android
if errorlevel 1 (
echo.
echo ERROR: android directory not found. Run: npx cap add android
exit /b 1
)
echo [4/4] Building debug APK (gradlew assembleDebug)...
call gradlew.bat assembleDebug
if errorlevel 1 (
echo.
echo ERROR: Gradle build failed.
exit /b 1
)
set "APK_REL=app\build\outputs\apk\debug\app-debug.apk"
set "APK_ABS=%CD%\%APK_REL%"
echo.
echo ========================================
echo Build succeeded
echo ========================================
echo.
echo Debug APK:
echo %APK_ABS%
echo.
echo Install on device: adb install -r "%APK_ABS%"
echo.
endlocal
exit /b 0