Rebrand your app
One command changes the app name, Android package, iOS bundle ID, icon, splash screen, Firebase files, URL scheme, deep link domain, production API URL and starting color.
Things the apps download from the API at launch are set in the admin panel instead: logo, colors, theme preset, font, corner style, app name in the UI, languages and feature switches. See step 4 and theming.md.
1. Prepare your files
Put your files in mobile/branding/:
| File | Notes |
|---|---|
icon.png |
1024×1024 PNG. No transparency: iOS rejects icons with alpha, and the script removes it for iOS. |
splash.png (optional) |
Your logo, centered on the splash color. Keep it simple; Android 12+ crops it to a circle. |
google-services.json (optional) |
From Firebase, with Android apps for your package and <package>.dev. See push-notifications.md. |
GoogleService-Info.plist (optional) |
From Firebase, for your iOS bundle ID |
The Firebase files are in .gitignore.
2. Fill in rebrand.yaml
cd mobile
cp rebrand.example.yaml rebrand.yaml
app_name: "FixIt Pro"
android_package: com.acme.fixit # can't change after publishing
ios_bundle_id: com.acme.fixit # can't change after publishing
url_scheme: fixit
deep_link_domain: app.acme.com
api_base_url_prod: https://api.acme.com/api/v1
apple_merchant_id: merchant.com.acme.fixit # optional, for Apple Pay
icon: branding/icon.png
splash_image: branding/splash.png
splash_color: "#0E7C7B"
primary_color: "#0E7C7B"
firebase:
android: branding/google-services.json
ios: branding/GoogleService-Info.plist
Only app_name, android_package and ios_bundle_id are required. Leave out what you don't need yet and run the script again later.
3. Run it
dart run tool/rebrand.dart --config rebrand.yaml --dry-run # see what would change
dart run tool/rebrand.dart --config rebrand.yaml
It's safe to run again. It reads the current IDs from the project and only changes what differs. --skip-assets skips the icon and splash generation.
| What | Where |
|---|---|
Android package (applicationId, namespace), MainActivity.kt moved to the new folder |
android/app/build.gradle.kts, android/app/src/main/kotlin/... |
App name: prod gets app_name, dev gets app_name Dev |
Android flavors, iOS Info.plist |
| iOS bundle ID in every configuration, including the test target | ios/Runner.xcodeproj/project.pbxproj |
| URL scheme | Android default (APP_SCHEME), iOS CFBundleURLSchemes |
| Deep link domain | Android App Links default (DEEP_LINK_HOST); iOS Runner.entitlements with applinks:<domain> |
| Push on iOS | aps-environment in Runner.entitlements when an iOS Firebase file is given |
| Firebase files | android/app/google-services.json, ios/Runner/GoogleService-Info.plist (added to the Xcode project) |
| Production API URL | lib/core/env/app_env.dart (can still be overridden with --dart-define=API_BASE_URL=…) |
Apple Pay Merchant ID (when apple_merchant_id is set) |
lib/features/payments/domain/payment_sheet.dart (or --dart-define=APPLE_MERCHANT_ID=…) |
| Color and name before the config loads | lib/core/theme/design_tokens.dart, lib/app.dart |
| Launcher icons, splash screens (Android 12+ too) | via flutter_launcher_icons and flutter_native_splash |
The Dart package name (niceserve in imports) doesn't change. Users never see it.
4. Finish by hand
The script prints this checklist at the end:
-
Android signing: create an upload key once and keep it safe. If you lose it, you have to contact Google Play support to reset it.
keytool -genkey -v -keystore upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias uploadThen create
android/key.properties(not committed):storeFile=../upload-keystore.jks storePassword=… keyAlias=upload keyPassword=…The path is relative to
mobile/android/. Without this file, release builds use the debug key, which is fine for testing but rejected by Play. -
Play Console: create the app with your package. Under Test and release → App integrity, copy the app signing SHA-256 into Admin → Settings → Deep links.
-
App Store Connect: register the bundle ID with the Push Notifications and Associated Domains capabilities. Then open
ios/Runner.xcworkspaceand pick your team under Signing & Capabilities. -
Admin panel:
- Settings → Deep links: package, bundle ID, Apple team ID, app scheme and domain.
- Settings → Branding: app name, logo and colors as shown inside the app.
-
Firebase: if the apps aren't registered yet, register them, then upload the APNs key (push-notifications.md).
5. Build
flutter build appbundle --flavor prod -t lib/main_prod.dart # Play Store
flutter build ipa -t lib/main_prod.dart # App Store (on a Mac)
Before you publish, test a debug build on a phone. Check that sign-in works, that a push arrives, and that a shared provider link opens the app.
Troubleshooting
| Symptom | Fix |
|---|---|
rebrand.yaml: android_package must look like… |
Lowercase letters, digits and dots, at least two parts, e.g. com.acme.fixit |
| Gradle: "No matching client found for package name" | google-services.json has no app for that package. Add <package> and <package>.dev in Firebase and download the file again |
| iOS: "Provisioning profile doesn't include the Associated Domains entitlement" | Turn the capability on for the App ID in the Apple Developer portal, or remove deep_link_domain until you use links |
| Old icon still shows | Uninstall the app from the device; launchers cache icons |