Sub topic 11
Testing the Release Build on Real Devices
Assume you know basic Dart and Flutter development, can use a terminal, and have Android tooling installed. For iOS testing, you also need macOS, Xcode, an Apple development team, and a registered device or TestFlight access.
A release build uses different settings from a debug build. It disables the Dart observatory and hot reload, removes some debugging checks such as assert, applies compiler optimizations, and may use different environment values. Test the release artifact rather than assuming that a debug run proves the app is ready.
Choose the artifact and device
Use an APK for a direct Android device test. Use an Android App Bundle through Google Play testing when you need to test the artifact that Play delivers. For iOS, use a signed IPA installed through Xcode, Apple Configurator, or TestFlight.
# List connected devices
flutter devices
# Build an Android release APK
flutter build apk --release
# Install the APK on a connected Android device
adb install -r build/app/outputs/flutter-apk/app-release.apk
# Run a release build directly on a selected Flutter device
flutter run --release -d <device-id>Replace <device-id> with the identifier printed by flutter devices. The -r option updates an existing Android installation while preserving its app data. Use a clean install when testing first-run behavior, permissions, migrations, or sign-in from an empty database.
For iOS, create the archive with the signing settings configured in Xcode:
flutter build ipa --releaseOpen the generated archive in Xcode Organizer, install it on a connected device, or upload it to TestFlight. TestFlight is useful because it exercises Apple’s distribution signing and lets testers install the same distribution style used before App Store release.
Follow a release smoke test
A smoke test is a short set of checks that confirms the main path works. Run it on every supported device class and operating-system version that matters to your users.
- Install from a clean state and launch the app.
- Confirm the display name, icon, version, and build number.
- Deny and allow each requested permission.
- Sign in, sign out, and restart the app.
- Exercise the main offline and online paths.
- Test deep links, push notifications, camera access, payments, and background work if the app uses them.
- Rotate the device, background the app, lock it, and reopen it.
- Check startup time, scrolling, animations, keyboard behavior, and memory use.
- Verify that production builds do not point at staging services or contain test credentials.
- Update an older installed version and verify database migrations.
Diagnose release-only failures
Release failures often come from assumptions that were true only in debug mode. A missing asset may be caused by an incorrect pubspec.yaml entry. A crash after obfuscation may require a plugin configuration or a preserved symbol. A blank screen may indicate that the release build received the wrong --dart-define value.
Capture the device model, operating-system version, app version, build number, reproduction steps, and logs. Android logs can be viewed with adb logcat. iOS logs are available in Xcode’s Devices and Simulators window or the macOS Console app. Avoid logging tokens, passwords, personal data, or complete request bodies.
Exercise
Exercise
Why should you test both a clean installation and an upgrade installation?
Show answer
A clean installation checks first-run setup and permissions, while an upgrade installation checks data migrations, preserved sessions, and compatibility with older stored data.