Local testing
If you want to test Expo Open OTA locally, you can use the provided docker-compose file to run the server locally and expose it on internet using reverse proxy like ngrok.
Clone the repositoryβ
git clone https://github.com/axelmarciano/expo-open-ota
cd expo-open-ota
Setup .envβ
Setup environment variables by creating a .env file in the root directory of the project.
Setup the dashboard (local)β
The dashboard isnβt served at /dashboard when running locally. Start it in dev mode:
cd apps/dashboard
npm install
npm run dev
Run the server using docker-composeβ
docker-compose build
docker-compose up
The server is now running on port 3000.
π Running the Example Appβ
The example app is located in apps/example-app and is designed to help you test the update server locally.
βΉοΈ The app must be run in release mode to properly test OTA behavior.
Setup certificatesβ
The signing certificates required for update validation are located in:
apps/example-app/certs/certificate-dev.pem
apps/example-app/certs/public-key.pem
To enable update signature verification, you must configure these certificates in your server environment. Ref
Build the Example Appβ
yarn prebuild_production
OR
yarn prebuild_staging
Configure the Expo Projectβ
Create an Expo project in your Expo dashboard with two branches:
stagingproduction
Each branch should have its own release channel. Then retrieve the Project ID from the Expo dashboard.
Update app.jsonβ
In apps/example-app/app.json, replace YOUR_PROJECT_ID with your actual Expo project ID:
"extra": {
"router": {
"origin": false
},
"eas": {
"projectId": "YOUR_PROJECT_ID"
}
}
Android Setupβ
yarn prebuild_production # Prebuild the app with the 'production' config
cd android
./gradlew clean # Clean previous builds
./gradlew assembleRelease # Build the release APK
./gradlew installRelease # Install the release APK on a connected device/emulator
IOSβ
cd ios
pod cache clean --all
pod install
Then:
- Open the iOS project in Xcode: open ios/*.xcworkspace
- Go to: Product β Scheme β Edit Scheme
- Under Run, set Build Configuration to Release
Testing OTA Updatesβ
Once the app is installed in release mode, use the following commands to test OTA updates:
yarn release_production # Publish an update to the 'production' channel
yarn release_staging # Publish an update to the 'staging' channel
The app will dynamically switch between channels at runtime if configured accordingly.