Mobile
Quick Reference Commands
Staging Deployment
# iOS Staging
npm run deploy-ios-staging
# Android Staging
npm run deploy-android-staging
Production Deployment
# iOS Production
npm run deploy-ios-prod
# Android Production
npm run deploy-android-prod
Required Authentication Files
Warning: These authentication files are crucial for deployment and must be properly configured. Never commit these files to version control!
iOS Authentication
App Store Connect API Keys - Two separate keys are required:
fastlane/
├── prod_auth_key.p8 # Production deployments
└── qa_auth_key.p8 # TestFlight/Beta deployments
Staging Configuration:
app_store_connect_api_key(
key_id: 'G29C8F9P69',
issuer_id: '69a6de95-eb63-47e3-e053-5b8c7c11a4d1',
key_filepath: './fastlane/qa_auth_key.p8'
)
Production Configuration:
app_store_connect_api_key(
key_id: 'T945WQ6TJQ',
issuer_id: '69a6de95-eb63-47e3-e053-5b8c7c11a4d1',
key_filepath: './fastlane/prod_auth_key.p8'
)
Android Authentication
Google Play Console Authentication - Required for Android deployments:
json_key_file("./pivot-inc-656b450b7a70.json")
package_name("com.pivot3")
Development Workflow
1. Environment Setup
Set the active environment:
# Development
npm run set-dev
# Staging
npm run set-stage
# Production
npm run set-prod
Note: These commands update
./src/active.env.jswith the appropriate environment.
2. Local Development
iOS Development:
# Run on device with cache reset
npm run start-ios-device
# Development environment
npm run ios-dev
# Production environment
npm run ios-prod
Android Development:
# Development environment
npm run android-dev
# Production environment
npm run android-prod
3. Testing Builds
Android APK Installation:
# Install staging build
npm run android-install-staging
# Install release build
npm run android-install-release
Deployment Process
1. Pre-deployment Setup
- Git SHA is added to builds for tracking:
npm run add-git-sha
- Verify environment and authentication files:
# Check environment
cat ./src/active.env.js
# Verify auth files
ls fastlane/qa_auth_key.p8 # For staging
ls fastlane/prod_auth_key.p8 # For production
2. Staging Deployment
iOS Staging:
npm run deploy-ios-staging
This command:
- Sets staging environment
- Adds Git SHA for version tracking
- Runs Fastlane iOS beta lane
- Uploads source maps to Rollbar
Android Staging:
npm run deploy-android-staging
This command:
- Sets staging environment
- Adds Git SHA
- Builds staging APK (
assembleQaRelease) - Runs Fastlane Android beta lane
- Uploads source maps for QA debug build
3. Production Deployment
iOS Production:
npm run deploy-ios-prod
This command:
- Sets production environment
- Adds Git SHA
- Runs Fastlane iOS release lane with UTF-8 encoding
- Uploads production source maps
Android Production:
npm run deploy-android-prod
This command:
- Sets production environment
- Adds Git SHA
- Runs Fastlane Android playstore lane
- Uploads production source maps
4. Source Maps Management
Source maps are automatically handled:
# iOS source maps
npm run upload-ios-maps
# Android source maps
npm run upload-android-maps [path-to-map]
Environment-Specific Configurations
Firebase Setup
iOS:
- Development:
GoogleService-Info-development.plist - Production:
GoogleService-Info-production.plist
Files are automatically copied during build:
cp ./ios/firebase/GoogleService-Info-[environment].plist ./ios/pivot3/GoogleService-Info.plist
Android:
Build variants handle Firebase config:
devDebugfor developmentprodDebugfor production testingprodReleasefor store releases
Build Variants
Android Build Types:
- QA Debug: Development testing
- QA Release: Staging deployments
- Prod Debug: Production testing
- Prod Release: Store releases
iOS Build Configurations:
- Debug: Development builds
- Release: TestFlight/App Store builds
Pre-release Checklist
Environment Verification
- Correct environment set (
npm run set-[env]) - Firebase configuration matches environment
- API endpoints configured correctly
- Git SHA added for version tracking
- Authentication files in place
Build Verification
- All dependencies installed (
npm install) - TypeScript checks pass
- ESLint passes (
npm run lint) - Tests pass (
npm test)
Platform-Specific Checks
iOS:
- Correct provisioning profiles synced
- Certificates valid
- Correct GoogleService-Info.plist
- Bundle ID matches environment
- Auth keys present and valid
Android:
- Correct build variant selected
- Keystore available
- Version code incremented
- google-services.json matches environment
- Play Store JSON key in place
Post-Deploy Verification
- Source maps uploaded successfully
- Rollbar reporting correctly
- Firebase services working
- Push notifications functional
- Deep links working