-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·43 lines (33 loc) · 1.03 KB
/
deploy
File metadata and controls
executable file
·43 lines (33 loc) · 1.03 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
#!/bin/bash
set -e # Exit on any error
WIFI_NAME="${1:-FTC-B1Mb}"
FTC_IP="${2:-192.168.43.1:5555}"
MODULE_NAME="TeamCode"
APK_PATH="./$MODULE_NAME/build/outputs/apk/release/$MODULE_NAME-release.apk"
echo "=== Pioneer Quick Build & Deploy ==="
echo ""
# Connect to WiFi if nmcli is available
if command -v nmcli >/dev/null 2>&1; then
echo "Connecting to WiFi: $WIFI_NAME..."
nmcli device wifi connect "$WIFI_NAME"
fi
# Build release APK
echo "Building release APK..."
./gradlew assembleRelease --quiet
# Connect to device
echo "Connecting to $FTC_IP..."
if ! adb connect "$FTC_IP"; then
echo "Warning: Could not connect to $FTC_IP, checking for USB devices..."
fi
# Check for connected devices
if ! adb devices | grep -q "device$"; then
echo "Error: No devices connected. Please connect via USB or ensure WiFi connection."
exit 1
fi
echo "Device connected successfully"
# Install APK
echo "Installing $APK_PATH..."
adb install -r "$APK_PATH"
echo ""
echo "=== Deployment Complete ==="
echo "APK installed successfully!"