Overview
Meteor integrates with Apache Cordova to build native mobile apps for iOS and Android from your web application codebase. Run your Meteor app on mobile devices with full access to native device features.What is Cordova?
Cordova allows you to:- Package web apps as native mobile applications
- Access device features like camera, GPS, and local storage
- Deploy to app stores (Apple App Store, Google Play Store)
- Update apps remotely via hot code push
A Cordova app is a web app running in a native WebView container with access to native device APIs through plugins.
Key Benefits
Single Codebase
Write once, deploy to web, iOS, and Android:Hot Code Push
Update your app without going through app store review:Faster Loading
Assets are bundled with the app:Adding Mobile Platforms
Add iOS Platform
- macOS with Xcode installed
- Xcode Command Line Tools
- iOS Simulator or physical iOS device
Add Android Platform
- Java Development Kit (JDK)
- Android SDK / Android Studio
- Android emulator or physical Android device
ANDROID_HOMEenvironment variable set
List and Remove Platforms
Running on Mobile
iOS Simulator
iOS Device
Android Emulator
Android Device
Cordova Plugins
Plugins provide access to native device features.Adding Plugins
Using Plugins in Code
Common Plugins
Mobile Configuration
Createmobile-config.js in your app root:
Platform Detection
Hot Code Push
Meteor automatically updates mobile apps with new code:Controlling Updates
Building for Production
iOS Production Build
Android Production Build
Local Files and Assets
Accessing Local Files
Loading Local Assets
Troubleshooting
Common Issues
Build Failures:Performance Tips
- Optimize Images: Use appropriate resolutions for mobile
- Minimize Animations: Use CSS transforms over JavaScript
- Lazy Load: Load data and images as needed
- Cache Data: Use local storage for offline support
- Test on Devices: Simulators don’t reflect real performance