forked from tranvuongquocdat/SideScreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_android.sh
More file actions
executable file
Β·37 lines (30 loc) Β· 1.13 KB
/
Copy pathinstall_android.sh
File metadata and controls
executable file
Β·37 lines (30 loc) Β· 1.13 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
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
APK_PATH="$ROOT_DIR/AndroidClient/app/build/outputs/apk/debug/app-debug.apk"
echo "π± Installing Android app..."
# Check if APK exists
if [ ! -f "$APK_PATH" ]; then
echo "β APK not found. Building first..."
"$SCRIPT_DIR/build_android.sh"
fi
# Check ADB connection
if ! adb devices | grep -q "device$"; then
echo "β No Android device found via ADB"
echo " Please connect your device via USB and enable USB debugging"
exit 1
fi
# Install APK
adb install -r "$APK_PATH"
echo ""
echo "β
App installed successfully!"
echo ""
echo "π² Setting up USB port forwarding..."
adb reverse --remove tcp:8888 2>/dev/null || true
adb reverse tcp:8888 tcp:8888
echo "β
Port 8888 forwarded"
echo ""
echo "βββββββββββββββββββββββββββββββββββββββββββ"
echo "Ready! Open 'Side Screen' on your Android device"
echo "βββββββββββββββββββββββββββββββββββββββββββ"