Prerequisites
Before creating production builds:- ✅ Complete setup and successfully run the app
- ✅ Have necessary signing credentials (certificates, provisioning profiles, keystores)
- ✅ Verify
.envis properly configured
Building for iOS
Build Configurations
Rainbow iOS has multiple build configurations:- Debug - Development builds with debugging enabled
- Release - Production builds with optimizations
Build from Xcode
Select build configuration
- Product → Scheme → Edit Scheme
- Select Run in left sidebar
- Change Build Configuration to Release
Archive for App Store
Create an archive for App Store submission:Archive
Product → Archive (or Cmd+Shift+B might work depending on shortcuts).This builds the app and creates an archive in Xcode’s Organizer.
Build with Fastlane
Rainbow uses Fastlane for automated builds:Fastlane lanes are defined in
ios/fastlane/Fastfile. Check the file for available lanes. Common lanes might include beta, release, staging, etc.Building for Android
Build Debug APK
Create a debug APK for testing:android/app/build/outputs/apk/debug/app-debug.apk
Build Release APK
Create an optimized release APK:- Checks environment with
./scripts/check-env.sh - Builds release APK
- Uninstalls existing app
- Installs the new APK
android/app/build/outputs/apk/release/app-release.apk
Build Release Bundle (AAB)
Create an Android App Bundle for Google Play Store:android/app/build/outputs/bundle/release/app-release.aab
Google Play requires AAB format (not APK) for new app submissions. AAB allows Google Play to generate optimized APKs for each device configuration.
Install Release APK
Install the release APK on a connected device:Build with Fastlane
Android also uses Fastlane for automated builds:Code Signing
iOS Code Signing
For iOS, you need:- Apple Developer Account (individual or organization)
- Signing Certificate (Developer or Distribution)
- Provisioning Profile (Development or App Store)
For Internal Developers
Signing is configured automatically viarainbow-scripts and certificates from rainbow-env.
For External Contributors
Configure signing in Xcode:- Open
ios/Rainbow.xcworkspace - Select Rainbow target
- Go to Signing & Capabilities
- Select your Team
- Xcode manages provisioning profiles automatically (or use manual signing)
Android Code Signing
For Android, you need a keystore file.For Internal Developers
Keystore is configured viarainbow-scripts and rainbow-env.
For External Contributors
Create a keystore:android/gradle.properties:
android/app/build.gradle signing config to use these properties.
Environment Configuration
Production Environment
Ensure your.env has production values:
Check Environment
Before building, verify environment:Build Optimizations
Android ProGuard/R8
Release builds use R8 for code shrinking and obfuscation:android/app/proguard-rules.pro.
iOS Optimization
Release builds automatically:- Strip debug symbols
- Enable optimizations
- Reduce bundle size
- Enable bitcode (if configured)
Versioning
Update version numbers before building:iOS Version
Update in Xcode:- Select Rainbow target
- General tab → Version (e.g.,
2.0.20) - General tab → Build (e.g.,
1)
ios/Rainbow/Info.plist:
Android Version
Editandroid/app/build.gradle:
- versionCode: Integer that must increase with each release (e.g., 2020001)
- versionName: User-facing version string (e.g., “2.0.20”)
package.json Version
Also updatepackage.json:
Build Verification
Verify Release Build
Before distributing, verify the release build:Test critical paths
- App launches without crashes
- Wallet creation/import works
- Transactions work
- No console errors
Check bundle size
Ensure bundle size is reasonable:iOS: Check in Xcode Organizer after archivingAndroid:
Automated Testing
Run tests before building:Distribution
iOS Distribution
- Archive the app in Xcode
- Validate the archive
- Upload to App Store Connect
- Fill in app metadata
- Submit for review
Android Distribution
- Build AAB:
yarn android:bundle - Go to Google Play Console
- Create a new release
- Upload the AAB file
- Fill in release notes
- Submit for review
Internal Distribution
TestFlight (iOS)
- Upload build to App Store Connect
- Go to TestFlight section
- Add internal/external testers
- Build is automatically available to testers
Firebase App Distribution (iOS & Android)
Distribute to testers via Firebase:Troubleshooting
iOS archive fails with signing error
iOS archive fails with signing error
Ensure you have:
- Valid signing certificate in Keychain
- Matching provisioning profile
- Correct bundle identifier
Android build fails with 'Execution failed for task :app:lintVitalRelease'
Android build fails with 'Execution failed for task :app:lintVitalRelease'
Lint errors are blocking the build. Fix lint errors or disable:
Release build crashes but debug works
Release build crashes but debug works
Common causes:
- ProGuard removing necessary code (Android) - update proguard-rules.pro
- Missing environment variables - verify .env
- Code optimization issues - check for dynamic code that might break when minified
AAB/APK size is too large
AAB/APK size is too large
Reduce size:
- Enable ProGuard/R8 (should be default for release)
- Remove unused resources
- Use vector graphics instead of PNGs
- Enable split APKs per ABI:
Next Steps
Debugging
Debug production issues and run E2E tests
Architecture
Understand Rainbow’s architecture and codebase