This guide explains how to deploy the Protein Tracker app to web, Android, and iOS platforms.
- Prerequisites
- Web Deployment (GitHub Pages)
- Android Deployment
- iOS Deployment
- Environment Variables
- Build Profiles Explained
- Common Commands Summary
- EAS Updates (Over-the-Air Updates)
- Troubleshooting
- Additional Resources
- Support
Before deploying the app, ensure you have:
- Node.js (v20 or higher) and npm installed
- Expo CLI (optional, npx can be used instead):
npm install -g @expo/cli # Or use npx expo for commands without global installation - EAS CLI installed globally (for mobile builds):
npm install -g eas-cli
- Expo Account: Create a free account at expo.dev
- All dependencies installed:
npm install
The app is configured to automatically deploy to GitHub Pages when code is pushed to the main branch.
The deployment is handled by the GitHub Actions workflow (.github/workflows/deploy.yml):
-
Push to main branch:
git push origin main
-
GitHub Actions will automatically:
- Install dependencies
- Build the web version using
npx expo export --platform web - Deploy the generated
distfolder to GitHub Pages
-
Access your app at:
https://reivaxmar.github.io/protein-tracker
If you need to deploy manually:
-
Build the web version:
npx expo export --platform web -
Deploy the
distfolder to your web hosting service
The web deployment is configured in app.config.js:
web: {
favicon: "./assets/favicon.png",
bundler: "metro",
output: "static"
},
experiments: {
baseUrl: "/protein-tracker"
}And in package.json:
{
"homepage": "https://reivaxmar.github.io/protein-tracker"
}To deploy the app to Android devices and the Google Play Store, use Expo Application Services (EAS Build).
-
Login to Expo:
eas login
-
Configure your project:
eas build:configure
This creates an
eas.jsonfile. For Android, use this configuration:{ "build": { "production": { "android": { "buildType": "aab" } }, "preview": { "android": { "buildType": "apk" } }, "development": { "developmentClient": true, "distribution": "internal" } } }
-
Build APK for testing (doesn't require Google Play account):
eas build --platform android --profile preview
-
Build AAB for Google Play Store:
eas build --platform android --profile production
-
Download the build when complete:
- The EAS CLI will provide a download link
- Or visit https://expo.dev and navigate to your project builds
-
Create a Google Play Developer account ($25 one-time fee)
-
Create an app in the Google Play Console
-
Use EAS Submit:
eas submit --platform android
Or manually upload the AAB file to Google Play Console.
-
Complete the store listing:
- App name, description, screenshots
- Privacy policy
- Content rating
- Pricing and distribution
For testing without Google Play:
- Transfer the APK to your Android device
- Enable "Install from Unknown Sources" in device settings
- Open and install the APK file
To deploy the app to iOS devices and the App Store, use EAS Build with an Apple Developer account.
- Apple Developer Account ($99/year)
- Enrolled in the Apple Developer Program
-
Login to Expo:
eas login
-
Configure your project (if not done already):
eas build:configure
-
Update
app.config.jswith your bundle identifier:ios: { supportsTablet: true, bundleIdentifier: "com.yourcompany.proteintracker" }
-
Build for internal testing (iOS Simulator):
eas build --platform ios --profile development
-
Build for TestFlight/App Store:
eas build --platform ios --profile production
-
EAS will handle:
- Creating necessary provisioning profiles
- Signing the app with your Apple Developer credentials
- Building the IPA file
-
Use EAS Submit:
eas submit --platform ios
-
Or manually via Xcode:
- Download the IPA file
- Use Xcode's Application Loader or Transporter app
- Upload to App Store Connect
-
Complete the App Store listing:
- App name, description, keywords
- Screenshots (multiple sizes required)
- Privacy policy
- App Store categories
- Pricing and availability
-
Submit for review:
- Apple typically reviews apps within 24-48 hours
- Address any feedback from the review team
For internal testing before App Store submission:
-
Use TestFlight:
eas build --platform ios --profile preview eas submit --platform ios --profile preview
-
Invite testers through App Store Connect
-
Testers install via TestFlight app on their iOS devices
If your app requires environment variables (API keys, etc.):
-
Create a
.envfile (don't commit to git):API_KEY=your_api_key_here -
Use
eas.jsonto set environment variables:{ "build": { "production": { "env": { "API_KEY": "production_key" } } } } -
Or use EAS Secrets:
eas secret:create --name API_KEY --value your_api_key
- development: For development builds with debugging enabled
- preview: For testing builds (APK for Android, TestFlight for iOS)
- production: For store submissions (AAB for Google Play, IPA for App Store)
# Build web
npx expo export --platform web
# Run web locally
npm run web# Build APK
eas build --platform android --profile preview
# Build for Play Store
eas build --platform android --profile production
# Submit to Play Store
eas submit --platform android# Build for iOS
eas build --platform ios --profile production
# Submit to App Store
eas submit --platform ios# Build for both
eas build --platform all --profile production
# Submit to both stores
eas submit --platform allThe app requires camera permissions for barcode scanning. Ensure the permissions are properly configured in app.config.js:
plugins: [
[
"expo-camera",
{
cameraPermission: "Allow Protein Tracker to access camera to scan barcodes."
}
]
]- Check logs: EAS provides detailed build logs
- Dependencies: Ensure all dependencies are compatible with the Expo SDK version
- Clear cache: Try
eas build --platform [platform] --clear-cache
If the app doesn't work correctly on GitHub Pages:
- Verify
experiments.baseUrlinapp.config.jsmatches your repository name - Verify the workflow uploads and deploys the generated
distfolder
EAS Update allows you to publish over-the-air (OTA) updates to your app without going through the app stores.
Before you can publish OTA updates:
-
EAS CLI must be installed (see Prerequisites section above)
-
Login to EAS CLI:
eas login
-
Update the Project ID in
app.config.js:- Run
eas project:initto create/link your project - Find your project ID in the Expo dashboard or by running
eas project:info - Update
app.config.js:updates: { url: "https://u.expo.dev/YOUR_PROJECT_ID" // Replace with actual project ID }
- Alternatively, you can remove the
updates.urlfield and let EAS automatically configure it during the build process.
- Run
-
Build Your App with EAS Update support:
# For both platforms eas build --platform all --profile production
Once your app is built and distributed, you can publish OTA updates:
eas update --branch production --message "Fix for login bug"eas update --branch preview --message "Testing new feature"- On App Launch: The app checks for updates when it starts (only in production builds)
- Download: If an update is available, it's downloaded in the background
- Apply: The update is applied automatically, and the app reloads
- Seamless: Users get the latest version without going to the app store
- Development Mode: Updates are NOT checked in development mode (
expo start) - Production Builds: Updates are checked every time the app launches
- Silent Updates: The update process happens silently without user interaction
- Error Handling: If update check fails, the app continues to work normally
✅ Can be updated OTA:
- JavaScript code changes
- React components
- Business logic
- Styles and layouts
- Assets (images, fonts)
- Configuration that doesn't affect native code
❌ Cannot be updated OTA (requires new build):
- Native code changes
- New native modules or packages
- Changes to
app.config.jsthat affect native configuration - Permission changes
- Plugin configuration changes
- Expo SDK version updates
- App icon or splash screen
If you need to rollback to a previous version:
eas update --branch production --message "Rollback to previous version" --republishYou can monitor your updates in the Expo dashboard:
- Go to https://expo.dev
- Select your project
- Navigate to "Updates" section
- View deployment history, adoption rates, and errors
- Test Before Publishing: Always test updates in preview channel before production
- Meaningful Messages: Use descriptive messages when publishing updates
- Monitor Adoption: Check the Expo dashboard to see how many users have the update
- Gradual Rollout: Consider using branches to gradually roll out updates
- Version Tracking: Keep track of which features require new builds vs OTA updates
- Verify the app is a production build (not development)
- Check that the
runtimeVersioninapp.config.jsmatches your build - Ensure the project ID in
updates.urlis correct - Check the Expo dashboard for update status
- Check the Expo dashboard for error reports
- Roll back to the previous version if necessary
- Test the update locally before publishing
- Expo Documentation
- EAS Build Documentation
- EAS Submit Documentation
- EAS Update Documentation
- Expo Updates SDK Documentation
- Runtime Version Policies
- App Store Connect
- Google Play Console
- Expo Application Services
For issues or questions:
- Check the Expo Forums
- Review the GitHub Issues
- Consult the React Native documentation