Build Process Overview
The Rodando Passenger app build process involves:- Angular Build - Compile TypeScript and bundle the web app
- Capacitor Sync - Copy web assets to native platforms
- Native Build - Build platform-specific packages (APK/IPA)
Building for Web
Development Build
Build with development configuration:www/ directory with:
- Source maps enabled
- No code minification
- Faster build times
Production Build
Build optimized for production:ng build with the production configuration by default, creating an optimized build with:
- Code minification and optimization
- Environment file replacement (
environment.ts→environment.prod.ts) - Output hashing for cache busting
- License extraction
- Bundle size checks (2MB warning, 5MB error)
Watch Mode
For continuous building during development:ng build --watch --configuration development to automatically rebuild on file changes.
Build Output
All builds output to thewww/ directory:
Building for Android
Prerequisites
Android Studio Setup
Ensure Android Studio is installed with:
- Android SDK (API 33 or higher)
- Android SDK Build-Tools
- Android SDK Platform-Tools
- Java JDK 17
Build Process
Sync to Android
Copy web assets and sync Capacitor plugins:This command:
- Copies
www/contents toandroid/app/src/main/assets/public/ - Updates native plugin dependencies
- Configures native project settings
Command Line Build (Alternative)
Build directly from command line:- Debug APK:
android/app/build/outputs/apk/debug/app-debug.apk - Release APK:
android/app/build/outputs/apk/release/app-release.apk - Release AAB:
android/app/build/outputs/bundle/release/app-release.aab
Building for iOS
Prerequisites
macOS and Xcode
iOS builds require:
- macOS
- Xcode (latest stable version)
- Xcode Command Line Tools
- CocoaPods
Build Process
Sync to iOS
Copy web assets and sync Capacitor plugins:This command:
- Copies
www/contents toios/App/App/public/ - Updates native plugin dependencies via CocoaPods
- Configures native project settings
Configure Signing
In Xcode:
- Select the App target
- Go to Signing & Capabilities
- Select your Team
- Configure Bundle Identifier
- Enable automatic signing or configure manual signing
Command Line Build (Alternative)
Build from command line using xcodebuild:Production Checklist
Before deploying to production:Update Environment Configuration
- Set production API URLs in
environment.prod.ts - Set
production: true - Set
debug: false - Update WebSocket URLs to production
- Verify Mapbox token is production-ready
Update Capacitor Config
- Set production
appId(e.g.,com.rodando.passenger) - Remove
serverconfiguration - Update
appNameto production name
Test Production Build
- Test production build locally
- Verify API connections
- Test on physical devices
- Check app performance
- Verify maps and location services
Deployment Strategies
Over-the-Air (OTA) Updates
For web content updates without app store releases, consider:- Capacitor Live Updates
- Ionic Appflow
- Custom update mechanisms
Continuous Integration/Deployment
Integrate build process into CI/CD pipelines:Build Optimization
Reduce Bundle Size
Optimize your production builds:-
Remove unused code
-
Analyze bundle size
-
Lazy load routes and modules
- Use Angular’s lazy loading for routes
- Load heavy components on-demand
-
Optimize images
- Compress images in
src/assets/ - Use appropriate formats (WebP, SVG)
- Compress images in
Build Performance
Speed up builds:- Use
--configuration developmentfor faster dev builds - Enable parallel builds in Angular
- Use incremental builds with
npm run watch - Clear cache if builds are corrupted:
rm -rf .angular/cache
Troubleshooting
Build Errors
TypeScript errors:Capacitor Sync Issues
Force sync:Android Build Issues
Clean Gradle cache:iOS Build Issues
Clean build:Next Steps
Development Setup
Set up your development environment
Configuration
Configure environment and build settings