Module Selection Guide
Overview
FastMediaSorter is a multi-module project with different build targets:
| Module | Type | Purpose |
|---|---|---|
| wear | Wear OS App | Smartwatch companion app |
| app_v2 | Android App | Main phone app (5 flavors: standard, vr, lite, photos, legacy) |
This guide explains how to select and configure which module runs by default.
Quick Selection (Interactive)
Run this script to interactively select your module:
.\scripts\select-wear-module.ps1
This will:
- Show available modules
- Guide you through selection
- Provide next steps with the selected module
Default Configuration: Wear OS
By default, Wear OS (Debug) is set as the startup module. This means:
- When you click the Run button in Android Studio, it builds and deploys to a Wear OS device
- The run configuration dropdown shows
wear [Debug]pre-selected
Why Wear OS is Default?
- ✅ Faster build times (smaller APK)
- ✅ Simpler configuration (single build variant)
- ✅ Ideal for Wear OS MVP testing
Changing Default Module
Option 1: Interactive Script (Recommended)
.\scripts\select-wear-module.ps1
Option 2: Manual Selection in Android Studio
- Click the Run Configuration dropdown in the toolbar
- It shows the module name (currently
wear [Debug])
- It shows the module name (currently
- Select your desired configuration:
wear [Debug]- Wear OS debug buildwear [Release]- Wear OS release buildapp [standardDebug]- Main app (Standard flavor)- Other app variants
- Click Run (green button or Shift+F10)
Option 3: Edit XML Configuration
Edit .idea/runConfigurations.xml:
<!-- To set Wear Debug as default: -->
<component name="RunManager" selected="Android App.wear [Debug]">
<!-- To set Main App Standard as default: -->
<component name="RunManager" selected="Android App.app [standardDebug]">
Then sync: File → Sync Now (Ctrl+Shift+Y)
Available Run Configurations
Wear OS Configurations
| Config | File | Type |
|---|---|---|
wear [Debug] |
.idea/runConfigurations/wear__Debug_.xml |
Android App |
wear [Release] |
.idea/runConfigurations/wear__Release_.xml |
Android App |
Main App Configurations
All in .idea/runConfigurations/:
| Flavor | Debug | Release |
|---|---|---|
| standard | app__standardDebug_ |
app__standardRelease_ |
| vr | app__vrDebug_ |
app__vrRelease_ |
| lite | app__liteDebug_ |
app__liteRelease_ |
| photos | app__photosDebug_ |
app__photosRelease_ |
| legacy | app__legacyDebug_ |
app__legacyRelease_ |
Building Without Changing Default
Build Wear OS
# Use build scripts (doesn't change default config)
.\scripts\builders\build-wear-debug.PS1
.\scripts\builders\build-wear-release.PS1
# Or use Gradle directly
.\gradlew.bat :wear:assembleDebug
.\gradlew.bat :wear:assembleRelease
Build Main App
# Use build scripts
.\scripts\builders\build-standard-debug.ps1
.\scripts\builders\build-lite-debug.ps1
.\scripts\builders\build-photos-debug.ps1
# Or use Gradle
.\gradlew.bat :app_v2:assembleStandardDebug
.\gradlew.bat :app_v2:assembleLiteDebug
.\gradlew.bat :app_v2:assemblePhotosDebug
Syncing After Configuration Changes
After changing the default module configuration:
File → Sync Now
Or press: Ctrl+Shift+Y
This reloads the project and applies the configuration changes.
Troubleshooting
“Run configuration not available”
- Sync Gradle:
File → Sync Now - Close and reopen Android Studio
- Check if all files exist in
.idea/runConfigurations/
“Wrong module selected when I click Run”
- Check
.idea/runConfigurations.xml- verify theselectedattribute - Look at the run configuration dropdown - it should show the active config
- Manually select the correct config before clicking Run
“I built the main app but need to switch to Wear”
# Use the selection script
.\scripts\select-wear-module.ps1
# Or manually select from dropdown in Android Studio
Command Reference
# Interactive module selection
.\scripts\select-wear-module.ps1
# Build Wear OS
.\scripts\builders\build-wear-debug.PS1 # Debug
.\scripts\builders\build-wear-release.PS1 # Release
# Build Main App (all flavors)
.\scripts\builders\build-standard-debug.ps1 # Standard Debug
.\scripts\builders\build-vr-debug.ps1 # VR Debug (headset)
.\scripts\builders\build-lite-debug.ps1 # Lite Debug
.\scripts\builders\build-photos-debug.ps1 # Photos Debug
.\scripts\builders\build-legacy-debug.ps1 # Legacy Debug
# Gradle direct builds (without changing default)
.\gradlew.bat :wear:assembleDebug
.\gradlew.bat :app_v2:assembleStandardDebug
# View all available tasks
.\gradlew.bat tasks
Configuration Files
| File | Purpose |
|---|---|
.idea/runConfigurations.xml |
Specifies default run config (wear [Debug]) |
.idea/runConfigurations/wear__Debug_.xml |
Wear OS Debug config |
.idea/runConfigurations/wear__Release_.xml |
Wear OS Release config |
.idea/runConfigurations/app__standardDebug_.xml |
Main App Standard Debug |
| (more app configs..) | Other app flavor configs |
Best Practices
- ✅ Use
select-wear-module.ps1for interactive selection - ✅ Use build scripts (
.\scripts\build-*.ps1) to avoid changing default - ✅ Sync Gradle (
Ctrl+Shift+Y) after manual configuration changes - ✅ Check the run config dropdown before clicking Run
- ✅ Keep Wear OS as default if you’re primarily testing the companion app
FAQ
Q: Can I have both Wear and Main app running? A: No, only one configuration is active at a time. But you can switch quickly between them using the dropdown.
Q: Does changing the default affect version numbers? A: No. Version numbering is independent of which module you run.
Q: How do I know which module is currently default? A: Look at the run configuration dropdown in the toolbar - it shows the active module.
Q: Can I create a custom run configuration? A: Yes - Run → Edit Configurations → + → Select module → Configure → OK
Q: Why is Wear OS the default? A: Faster iteration cycle for the companion app MVP. You can change this anytime.
For more details on building and testing, see:
- WEAR_OS_QUICK_START.md
- WEAR_OS_SETUP.md
- AGENTS.md - Development workflow