pipo_firebase_app_distribution 0.0.1
pipo_firebase_app_distribution: ^0.0.1 copied to clipboard
A Dart CLI tool to automatically upload APK/IPA to Firebase App Distribution with auto-detection of Firebase configuration from google-services.json and GoogleService-Info.plist
example/README.md
Pipo Firebase App Distribution - Usage Examples #
Complete examples of using pipo_firebase_app_distribution CLI tool.
Table of Contents #
Basic Usage #
Step 1: Install the package #
# Global installation
dart pub global activate pipo_firebase_app_distribution
# Or add to your project
dart pub add --dev pipo_firebase_app_distribution
Step 2: Initialize configuration #
Navigate to your Flutter project root:
cd /path/to/your/flutter/project
pipo_firebase init
This will scan your project and generate build.yaml.
Multi-Environment Setup #
Scenario: Dev, Staging, and Production #
Project Structure:
my_app/
├── android/
│ └── app/
│ └── src/
│ ├── dev/
│ │ └── google-services.json
│ ├── staging/
│ │ └── google-services.json
│ └── production/
│ └── google-services.json
├── ios/
│ └── Runner/
│ └── Firebase/
│ ├── dev/
│ │ └── GoogleService-Info.plist
│ ├── staging/
│ │ └── GoogleService-Info.plist
│ └── production/
│ └── GoogleService-Info.plist
└── pubspec.yaml
Run init command:
$ pipo_firebase init
🔍 Initializing Firebase App Distribution configuration...
✓ ✅ Firebase configurations scanned (52ms)
📋 Found Firebase configurations:
🤖 ANDROID (dev)
App ID: 1:123456:android:abc123def456
Bundle ID: com.example.myapp.dev
Project: my-app-dev-12345
🤖 ANDROID (staging)
App ID: 1:123456:android:ghi789jkl012
Bundle ID: com.example.myapp.staging
Project: my-app-staging-67890
🤖 ANDROID (production)
App ID: 1:123456:android:mno345pqr678
Bundle ID: com.example.myapp
Project: my-app-prod-11111
🍎 IOS (dev)
App ID: 1:123456:ios:stu901vwx234
Bundle ID: com.example.myapp.dev
Project: my-app-dev-12345
🍎 IOS (staging)
App ID: 1:123456:ios:yza567bcd890
Bundle ID: com.example.myapp.staging
Project: my-app-staging-67890
🍎 IOS (production)
App ID: 1:123456:ios:efg123hij456
Bundle ID: com.example.myapp
Project: my-app-prod-11111
✓ ✅ build.yaml generated successfully (2ms)
🎉 Firebase App Distribution initialized successfully!
📄 Generated file: build.yaml
Generated build.yaml Examples #
Example 1: Single Environment (Dev Only) #
Input: Only dev Firebase configs present
Generated build.yaml:
# Firebase App Distribution Build Configuration
# Auto-generated by pipo_firebase_app_distribution
# https://pub.dev/packages/pipo_firebase_app_distribution
project:
name: "my_app"
version: "1.0.0+1"
firebase:
project_id: "my-app-dev-12345"
project_number: "123456789"
timeout: 600
# Environment configurations
environments:
dev:
android_app_id: "1:123456:android:abc123def456"
android_bundle_id: "com.example.myapp.dev"
ios_app_id: "1:123456:ios:stu901vwx234"
ios_bundle_id: "com.example.myapp.dev"
group: "internal-testers"
setup:
build_mode: release
upload: true
obfuscate: false
auto_increment: true
clean: true
# Build presets
presets:
quick-dev:
environment: dev
build_mode: debug
upload: false
clean: false
test-build:
environment: staging
build_mode: release
upload: false
clean: true
production-release:
environment: production
build_mode: release
upload: true
clean: true
increment: true
# Default settings
defaults:
build_mode: release
upload: true
clean: true
auto_increment: true
obfuscate: false
# Platform-specific settings
platforms:
android:
build_format: apk # or aab for Play Store
flavor_dimension: environment
ios:
export_method: development # or app-store, ad-hoc, enterprise
team_id: "" # Add your Apple Team ID here
Example 2: Multiple Environments #
Input: Dev, Staging, and Production Firebase configs
Generated build.yaml:
# Firebase App Distribution Build Configuration
# Auto-generated by pipo_firebase_app_distribution
# https://pub.dev/packages/pipo_firebase_app_distribution
project:
name: "my_app"
version: "1.0.0+1"
firebase:
project_id: "my-app-dev-12345"
project_number: "123456789"
timeout: 600
# Environment configurations
environments:
dev:
android_app_id: "1:123456:android:abc123def456"
android_bundle_id: "com.example.myapp.dev"
ios_app_id: "1:123456:ios:stu901vwx234"
ios_bundle_id: "com.example.myapp.dev"
group: "internal-testers"
setup:
build_mode: release
upload: true
obfuscate: false
auto_increment: true
clean: true
staging:
android_app_id: "1:123456:android:ghi789jkl012"
android_bundle_id: "com.example.myapp.staging"
ios_app_id: "1:123456:ios:yza567bcd890"
ios_bundle_id: "com.example.myapp.staging"
group: "qa-team"
setup:
build_mode: release
upload: true
obfuscate: false
auto_increment: true
clean: true
production:
android_app_id: "1:123456:android:mno345pqr678"
android_bundle_id: "com.example.myapp"
ios_app_id: "1:123456:ios:efg123hij456"
ios_bundle_id: "com.example.myapp"
group: "release-team"
setup:
build_mode: release
upload: true
obfuscate: true
auto_increment: false
clean: true
# Build presets
presets:
quick-dev:
environment: dev
build_mode: debug
upload: false
clean: false
test-build:
environment: staging
build_mode: release
upload: false
clean: true
production-release:
environment: production
build_mode: release
upload: true
clean: true
increment: true
# Default settings
defaults:
build_mode: release
upload: true
clean: true
auto_increment: true
obfuscate: false
# Platform-specific settings
platforms:
android:
build_format: apk # or aab for Play Store
flavor_dimension: environment
ios:
export_method: development # or app-store, ad-hoc, enterprise
team_id: "" # Add your Apple Team ID here
Example 3: Android Only #
Input: Only Android Firebase configs present
Generated build.yaml:
# Firebase App Distribution Build Configuration
# Auto-generated by pipo_firebase_app_distribution
# https://pub.dev/packages/pipo_firebase_app_distribution
project:
name: "android_app"
version: "1.0.0+1"
firebase:
project_id: "android-app-12345"
project_number: "987654321"
timeout: 600
# Environment configurations
environments:
dev:
android_app_id: "1:987654:android:abc123"
android_bundle_id: "com.example.androidapp.dev"
group: "internal-testers"
setup:
build_mode: release
upload: true
obfuscate: false
auto_increment: true
clean: true
production:
android_app_id: "1:987654:android:xyz789"
android_bundle_id: "com.example.androidapp"
group: "release-team"
setup:
build_mode: release
upload: true
obfuscate: true
auto_increment: false
clean: true
# ... (presets, defaults, platforms remain the same)
Common Scenarios #
Scenario 1: Fresh Project with Firebase #
Steps:
- Add Firebase to your project via Firebase Console
- Download
google-services.json(Android) and/orGoogleService-Info.plist(iOS) - Place files in correct locations:
- Android:
android/app/google-services.json - iOS:
ios/Runner/GoogleService-Info.plist
- Android:
- Run
pipo_firebase init - Review and customize
build.yaml
Expected Result:
build.yamlwith single environment- App IDs automatically extracted
- Project info from
pubspec.yaml
Scenario 2: Existing Project with Multiple Flavors #
Steps:
-
Organize Firebase configs by flavor:
android/app/src/ ├── dev/google-services.json ├── staging/google-services.json └── production/google-services.json -
Run
pipo_firebase init -
Tool automatically detects all flavors
Expected Result:
build.yamlwith multiple environments- Each flavor has correct App IDs
- Environment-specific settings
Scenario 3: Updating Existing Configuration #
Steps:
- Make changes to Firebase configs (add new environment, update App IDs)
- Run
pipo_firebase init - Tool asks if you want to overwrite:
⚠️ build.yaml already exists. Overwrite? (y/N) - Choose
yto regenerate with latest configs
Result:
- Updated
build.yamlwith new configurations - Previous customizations will be lost (backup first!)
Scenario 4: Different Bundle IDs for iOS and Android #
Project:
- Android:
com.company.app.dev - iOS:
com.company.iosapp.dev
Generated build.yaml:
environments:
dev:
android_app_id: "1:123:android:abc"
android_bundle_id: "com.company.app.dev"
ios_app_id: "1:123:ios:def"
ios_bundle_id: "com.company.iosapp.dev" # Different bundle ID
group: "internal-testers"
# ...
Result:
- Tool correctly handles different bundle IDs
- Each platform gets correct configuration
Troubleshooting #
Issue: "No Firebase configuration files found" #
Problem:
❌ No Firebase configuration files found!
Expected files:
Android: android/app/google-services.json
iOS: ios/Runner/GoogleService-Info.plist
Solution:
- Verify Firebase config files exist
- Check file locations:
- Android: Must be in
android/app/orandroid/app/src/{flavor}/ - iOS: Must be in
ios/Runner/orios/Runner/Firebase/{flavor}/
- Android: Must be in
- Ensure files are named correctly (case-sensitive)
Issue: Environment Not Detected #
Problem: Configs found but environment shown as "unknown"
Solution: Environment detection works via:
- File path (e.g.,
src/dev/,Firebase/staging/) - Bundle ID suffix (e.g.,
.dev,.staging)
Make sure one of these methods can identify your environment.
Issue: Duplicate Configurations #
Problem: Same environment detected multiple times
Solution:
- Check if you have multiple config files for same environment
- Common cause: Config in both
android/app/andandroid/app/src/dev/ - Keep only one config per environment/platform
Issue: Wrong App ID Extracted #
Problem:
Generated build.yaml has wrong App ID
Solution:
- Verify your Firebase config file content
- For Android: Check
mobilesdk_app_idingoogle-services.json - For iOS: Check
GOOGLE_APP_IDinGoogleService-Info.plist - Re-download from Firebase Console if needed
Advanced Usage #
Custom Environment Names #
If using custom environment names (not dev/staging/production):
-
Organize configs in appropriate folders:
android/app/src/ ├── alpha/google-services.json └── beta/google-services.json -
Run
pipo_firebase init -
Tool creates environments named
alphaandbeta -
Manually adjust settings in
build.yamlas needed
Multiple Firebase Projects #
For projects using multiple Firebase projects:
- Keep configs separate by environment
- Run
pipo_firebase init - Tool detects different project IDs
- Review
firebase.project_idinbuild.yaml - Manually set correct project ID if needed
Next Steps #
After generating build.yaml:
- Review generated configuration
- Customize settings per your needs:
- Update distribution groups
- Adjust build modes
- Configure obfuscation settings
- Commit
build.yamlto version control - Use with your build system (future feature)
Feedback & Support #
Found an issue or have suggestions?