Automated scripts for building and running FlowFit on different devices.
Purpose: Automated build and installation on Galaxy Watch
Usage:
scripts\build_and_install.batWhat it does:
- Cleans previous builds (
flutter clean) - Gets dependencies (
flutter pub get) - Builds debug APK (
flutter build apk --debug) - Checks connected devices (
adb devices) - Installs on watch (
adb -s 6ece264d install)
Requirements:
- Watch connected and visible in
adb devices - Developer mode enabled on watch
- ADB debugging enabled on watch
Important: You must approve the installation on your watch screen when prompted!
Purpose: Quick run on Galaxy Watch
Usage:
scripts\run_watch.batWhat it does:
- Runs
flutter run -d 6ece264d - Launches app on watch in debug mode
- Enables hot reload
Requirements:
- Watch connected
- Previous build successful
Purpose: Quick run on Android Phone
Usage:
scripts\run_phone.batWhat it does:
- Runs
flutter run -d adb-RFAX21TD0NA-FFYRNh._adb-tls-connect._tcp - Launches companion app on phone
- Enables hot reload
Requirements:
- Phone connected
- Previous build successful
-
Connect your devices:
adb devices
Should show:
6ece264d device adb-RFAX21TD0NA-FFYRNh._adb-tls-connect._tcp device -
Build and install on watch:
scripts\build_and_install.bat -
Approve installation on watch when prompted
-
Run on watch:
scripts\run_watch.bat
For quick iterations during development:
# Make code changes, then:
scripts\run_watch.bat
# Or for phone:
scripts\run_phone.batHot reload will work automatically for quick UI changes.
If you prefer manual control:
# Clean build
flutter clean
flutter pub get
# Build APK
flutter build apk --debug
# Install
adb -s 6ece264d install -r build\app\outputs\flutter-apk\app-debug.apk
# Run with hot reload
flutter run -d 6ece264d
# Uninstall
adb -s 6ece264d uninstall com.example.flowfit# Run on phone
flutter run -d adb-RFAX21TD0NA-FFYRNh._adb-tls-connect._tcp
# Install APK
adb -s adb-RFAX21TD0NA-FFYRNh._adb-tls-connect._tcp install -r build\app\outputs\flutter-apk\app-debug.apkCheck devices:
adb devicesIf watch not showing:
- Check USB connection
- Enable ADB debugging on watch
- Restart ADB:
adb kill-server && adb start-server
Solution: Approve installation on watch screen
- Watch will show "Install app?" prompt
- Tap "Install" button
- Must approve within 30 seconds
Solution: This should be fixed in the latest build
- Check
android/app/src/main/AndroidManifest.xml - Ensure wearable library is set to
required="false"
Clean and rebuild:
flutter clean
flutter pub get
scripts\build_and_install.batCheck Kotlin errors:
- Review
android/app/src/main/kotlin/files - Check logcat for detailed errors
========================================
FlowFit Build and Install Script
========================================
Step 1: Cleaning previous builds...
✓ Clean complete
Step 2: Getting dependencies...
✓ Dependencies resolved
Step 3: Building APK for watch...
✓ Built build\app\outputs\flutter-apk\app-debug.apk
Step 4: Checking connected devices...
6ece264d device
Step 5: Installing on watch (6ece264d)...
✓ Installation successful
========================================
SUCCESS! App installed on watch
========================================
ERROR: Build failed
Compilation error. See log for more details
Common issues:
1. Kotlin compilation errors
2. Missing dependencies
3. SDK version mismatch
-
Use
run_watch.batfor quick iterations- Faster than full rebuild
- Hot reload enabled
- Good for UI changes
-
Use
build_and_install.batfor clean builds- After major changes
- After dependency updates
- When debugging build issues
-
Check logs regularly
adb -s 6ece264d logcat | findstr "FlowFit"
- Keep watch connected via USB for faster deployment
- Use hot reload (
rin terminal) for quick UI changes - Use hot restart (
Rin terminal) for state changes - Clean build only when necessary (it's slow)
You can create your own scripts based on these templates:
@echo off
echo Cleaning and reinstalling...
flutter clean
adb -s 6ece264d uninstall com.example.flowfit
flutter pub get
flutter run -d 6ece264d@echo off
echo Viewing FlowFit logs...
adb -s 6ece264d logcat | findstr "FlowFit MainActivity HealthTrackingManager"- Installation Troubleshooting - Detailed error solutions
- Build Fixes Applied - Recent fixes
- Run Instructions - Device-specific commands
- Always approve installations on watch - Required for security
- Keep watch unlocked during install - Installation fails if locked
- Check battery level - Low battery can cause issues
- Use WiFi debugging - For wireless development (advanced)
Back to Main README