forked from PasscodesApp/Passcodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallondevice.bat
More file actions
69 lines (57 loc) · 1.82 KB
/
installondevice.bat
File metadata and controls
69 lines (57 loc) · 1.82 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
65
66
67
68
69
@REM WARNING: Script is Deprecated!! From 2025-07-29T12:45:00Z.
@REM Checkout: https://passcodesapp.github.io/Passcodes-Docs/dev-docs/building/
@REM Build & install on Android phone
echo "WARNING: Script is Deprecated!! From 2025-07-29T12:45:00Z. More Info:- https://passcodesapp.github.io/Passcodes-Docs/dev-docs/building/"
pause
@echo off
@REM Force continuation after Gradle command by capturing the output
if "%~1"=="prod" (
echo building a production build
call gradlew clean assembleRelease
if ERRORLEVEL 1 (
echo Gradle build failed! Check build_output.txt for details.
)
) else (
echo building a development build
call gradlew assembleDebug
if ERRORLEVEL 1 (
echo Gradle build failed! Check build_output.txt for details.
)
)
@REM Start ADB server
adb start-server
if ERRORLEVEL 1 (
echo Failed to start ADB server! Exiting...
)
@REM Check if a device is connected
adb devices
if ERRORLEVEL 1 (
echo No device found! Make sure your device is connected and USB debugging is enabled.
adb kill-server
)
@REM Install the APK on the connected device
if "%~1"=="prod" (
echo Installing a production apk
adb install ./app/build/outputs/apk/release/app-universal-release.apk
if ERRORLEVEL 1 (
echo Gradle build failed! Check build_output.txt for details.
)
) else (
echo Installing a dev apk
adb install ./app/build/outputs/apk/debug/app-universal-debug.apk
if ERRORLEVEL 1 (
echo Gradle build failed! Check build_output.txt for details.
)
)
if ERRORLEVEL 1 (
echo APK installation failed! Exiting...
adb kill-server
)
@REM Kill ADB server after installation
adb kill-server
if ERRORLEVEL 1 (
echo Failed to stop ADB server! Exiting...
)
echo Build and installation completed successfully!
pause
echo "Thanks for using this script!!!"