-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·49 lines (40 loc) · 1.31 KB
/
dev.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.31 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
#!/bin/bash
# Development script for hot-reloading Android app
export ANDROID_HOME=~/android-sdk
echo "🚀 Starting Listen app development mode..."
echo "📱 Make sure the emulator is running or device is connected"
echo "🔄 This script will continuously build and install the app"
echo ""
# Function to build and install
build_and_install() {
echo "🔨 Building app..."
./gradlew assembleDebug
if [ $? -eq 0 ]; then
echo "✅ Build successful! Installing..."
adb install -r app/build/outputs/apk/debug/app-debug.apk
if [ $? -eq 0 ]; then
echo "✅ App installed successfully!"
echo "📱 Launching app..."
adb shell am start -n com.listen.app/.ui.MainActivity
else
echo "❌ Failed to install app"
fi
else
echo "❌ Build failed!"
fi
echo ""
}
# Initial build and install
build_and_install
echo "👀 Watching for changes... (Press Ctrl+C to stop)"
echo "💡 Make changes to your code and save to trigger rebuild"
echo ""
# Watch for file changes and rebuild
while true; do
# Wait for any .kt or .xml file changes
inotifywait -r -e modify,create,delete app/src/ 2>/dev/null
if [ $? -eq 0 ]; then
echo "📝 File changed, rebuilding..."
build_and_install
fi
done