Development Guide
Dette innholdet er ikke tilgjengelig på ditt språk.
ELRS Mobile is a Flutter app that reimplements the ExpressLRS firmware build and flashing pipeline in Dart so it runs entirely on the phone, offline. This guide covers setting up, running, testing and releasing it.
Prerequisites
Section titled “Prerequisites”- Flutter (stable channel, Dart 3.11 or newer)
- Android SDK for Android builds; Xcode and CocoaPods on a Mac for iOS and macOS
- Python 3 for the firmware validation tools and changelog script
- Node.js 22 if you work on the website (
website/)
Getting started
Section titled “Getting started”git clone https://github.com/wbhinton/ELRS-Mobile.gitcd ELRS-Mobileflutter pub getflutter runGenerated code (*.g.dart, *.freezed.dart) and localizations are committed, so a fresh clone runs without a code-generation step. After editing a Freezed model, a JSON-serializable class or a @riverpod provider, regenerate:
dart run build_runner build --delete-conflicting-outputsAfter editing lib/l10n/app_en.arb, regenerate the localization classes:
flutter gen-l10nBuild-time options
Section titled “Build-time options”Two values are read with --dart-define at build time:
| Define | Effect |
|---|---|
SENTRY_DSN | Enables crash reporting. Without it, Sentry stays off. |
DISTRIBUTION=direct | Marks the direct-download APK: enables the daily update check and Settings → Check for Updates. Store builds omit it, since the stores handle updates. |
For local runs, copy dart_defines/local.json.example to dart_defines/local.json and pass it with flutter run --dart-define-from-file=dart_defines/local.json.
Project structure
Section titled “Project structure”The app follows a feature-first layout under lib/src/. Each feature is a vertical slice with its own domain, data, application or state, and presentation folders as needed; shared infrastructure lives in core/.
| Folder | Responsibility |
|---|---|
features/flashing/ | The core pipeline: target and version selection, firmware download and caching, on-device assembly, upload, and the safety checks (chip, target, binding phrase) |
features/config/ | Reads the connected device’s configuration, including fallbacks for firmware older than 3.1 |
features/configurator/ | Hosts the device’s own web configuration page in a locked WebView |
features/firmware_manager/ | Downloads, lists and deletes cached firmware versions |
features/dashboard/ | Home screen: connection status and navigation |
features/settings/ | Flashing profiles, regulatory defaults, storage, language, analytics, Expert Mode |
features/app_update/ | Update check for the direct-download APK |
features/support/, features/splash/ | Help, FAQ and recovery content; startup screen |
core/networking/ | mDNS discovery, connectivity, the serialized device HTTP client, Android Wi-Fi process binding |
core/storage/ | Preferences, encrypted secure storage, and the on-disk firmware cache |
core/analytics/ | Opt-in Aptabase usage analytics |
core/theme/, core/presentation/, core/utils/ | Theme, responsive layout, binding-phrase UID and validation helpers |
Routing uses go_router (lib/src/router.dart).
State management
Section titled “State management”State and dependency injection use Riverpod with code generation (@riverpod / @Riverpod(keepAlive: true)). Most screens are HookConsumerWidgets, using Flutter Hooks for local widget state. Domain models are immutable Freezed classes.
Localization
Section titled “Localization”All user-visible text lives in ARB files under lib/l10n/, with app_en.arb as the source. The app ships in 18 languages. Never hard-code UI text: test/l10n_hygiene_test.dart fails on hard-coded strings and on unused ARB keys. Add new strings in English only; translations are machine-generated by a manually triggered workflow (.github/workflows/translate.yml) so translation spend stays under direct control.
Testing
Section titled “Testing”flutter analyzeflutter testThe tests in test/ cover chip compatibility, flash error messages, the update check, the secure-storage upgrade, and localization (hygiene, message formatting, and layout overflow in every locale). CI (.github/workflows/ci.yml) runs flutter analyze, flutter test, and checks that generated localizations are up to date on every push to development and every pull request.
To verify firmware assembly against official binaries, see Firmware Validation.
Releases
Section titled “Releases”.github/workflows/release.yml runs on a v* tag or manual dispatch and builds:
- the direct-download APK (
DISTRIBUTION=direct), published to GitHub Releases and mirrored tocdn.elrsmobile.com; - the Android App Bundle for Google Play;
- the iOS build for the App Store.
The changelog is generated with python3 scripts/generate_changelog.py.
Website
Section titled “Website”The website and these docs live in website/ (Astro and Starlight). See website/README.md for where content lives and how to update it.
Deep dives
Section titled “Deep dives”- Technical Architecture: firmware assembly, the flashing pipeline, and the networking stack.
- Technical Specification: device endpoints, data models and persistence.
- Firmware Validation: tools for verifying binary integrity.