| name | expo-workflows |
| description | Expo SDK, EAS Build, EAS Update, and managed workflow best practices. |
Expo Workflows
Project Setup
# Create new project
npx create-expo-app@latest my-app --template tabs
# Install dependencies
npx expo install expo-router expo-status-bar
EAS Build
// eas.json
{
"cli": { "version": ">= 5.0.0" },
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
# Build for iOS
eas build --platform ios --profile production
# Build for Android
eas build --platform android --profile production
EAS Update (OTA)
# Configure
eas update:configure
# Push update
eas update --branch production --message "Bug fixes"
// Check for updates
import * as Updates from 'expo-updates';
async function checkForUpdates() {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
await Updates.fetchUpdateAsync();
await Updates.reloadAsync();
}
}
Environment Variables
# .env
EXPO_PUBLIC_API_URL=https://api.example.com
// Usage
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
Common Packages
npx expo install expo-camera
npx expo install expo-location
npx expo install expo-notifications
npx expo install expo-secure-store
npx expo install expo-image-picker
Development
# Start dev server
npx expo start
# Run on device
npx expo start --dev-client
# Clear cache
npx expo start -c