惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
雷峰网
雷峰网
IT之家
IT之家
小众软件
小众软件
M
MIT News - Artificial intelligence
博客园 - 聂微东
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
腾讯CDC
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
The Bulletproof Guide to Setting Up Expo EAS & OTA Update...
Debojit Das · 2026-06-16 · via DEV Community

Debojit Das

Setting up Expo Application Services (EAS) and Over-The-Air (OTA) updates for the first time feels like unlocking a developer superpower. The promise is incredible: ship bug fixes directly to your users' phones instantly, completely bypassing the App Store review process.

But if you set it up incorrectly, that superpower quickly turns into a nightmare of instant crashes, poisoned update channels, and the dreaded White Screen of Death (WSOD).

I recently navigated this minefield while building a production React Native app using Supabase and RevenueCat. I learned the hard way that the gap between local development and cloud builds is filled with hidden traps.

If you are setting up EAS and expo-updates from scratch, this step-by-step guide will ensure you get it right on the very first try.


Step 1: Master Your Environment Variables

This is where 90% of developers fail on their first EAS build. In local development, your app magically reads your .env file. In the cloud, your .env file is ignored (thanks to .gitignore), leaving your API keys blank and crashing your app on launch.

The Golden Rules of Expo Environments:

  1. The Prefix: Any API key that your frontend React Native code needs to read (like your Supabase URL or RevenueCat Public Key) must start with EXPO_PUBLIC_. If it doesn't, the Metro bundler will actively strip it out of your production build for security.
  2. The Local File: Keep a single .env.local file on your machine for development.

Your .env.local should look like this:

EXPO_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=appl_your_key

Upload to the Cloud:
Before you ever trigger a build, you must upload these exact variables to the EAS servers so they can be injected into your production app. Run these commands in your terminal:

eas env:create --name EXPO_PUBLIC_SUPABASE_URL --value "https://your-project.supabase.co" --environment production --visibility plaintext
eas env:create --name EXPO_PUBLIC_SUPABASE_ANON_KEY --value "your-anon-key" --environment production --visibility plaintext

Check your work by running eas env:list --environment production.


Step 2: Bulletproof Your app.json

EAS runs strict validation checks on your project manifest. If you have sloppy configuration, your OTA updates will be rejected at the 99% mark.

  1. Keep it DRY (Don't Repeat Yourself): Scroll through your app.json. Ensure you do not have duplicate entries in your iOS UIBackgroundModes, Android permissions, or intentFilters.
  2. Lock in the Runtime Version: OTA updates need to know which native binary they belong to. Add a strict runtime version to your app.json:
{
  "expo": {
    "name": "MyApp",
    "runtimeVersion": "1.0.0",
    "updates": {
      "url": "https://u.expo.dev/YOUR-PROJECT-ID"
    }
  }
}


Step 3: Configure eas.json Correctly

When you initialize EAS (via eas init), it generates an eas.json file. You need to explicitly tell your production profile to pull down the cloud environment variables you set up in Step 1, and map the build to an update channel.

Edit your eas.json to look like this:

{
  "build": {
    "production": {
      "channel": "production",
      "environment": "production"
    }
  }
}

Note: The "environment": "production" line is the magic link that pulls your eas env keys into the build.


Step 4: The Local Safety Check

Do not skip this step. Waiting 30 minutes in the EAS cloud queue just to discover your app crashes on launch is a brutal loop.

Because you are likely using custom native code, you can compile and test the true production release right on your local machine.

Run this command:

npx expo run:ios --configuration Release

(Or run:android --variant Release)

If the app boots up on your simulator, connects to your database, and doesn't white-screen, your JavaScript and native configurations are rock solid.


Step 5: The First Cloud Build

Now you are ready for the cloud. Trigger your first production build for TestFlight or the Google Play Console:

eas build --profile production --platform all

A Warning About Local Builds: If you try to save queue time by running eas build --local, the EAS CLI will ignore your local .env and will not reach out to the cloud to get your eas env variables. It will build a blank app. Always use the cloud build for your first clean run, or run eas env:pull before attempting a local EAS build.


Step 6: Pushing Your First OTA Update Safely

Once your app is live on TestFlight or the App Store, you will eventually want to push a bug fix over the air.

Unlike eas build (which happens in the cloud), eas update bundles your JavaScript locally on your computer before uploading it. This means it relies entirely on your local terminal's environment variables.

If your Metro bundler has stale cache, it might bundle your app without your EXPO_PUBLIC_ keys, resulting in a "poisoned" update that instantly crashes your users' apps.

The Golden Command for OTA Updates:
Always force Metro to clear its cache when pushing to production so it strictly reads your .env.local file:

eas update --branch production --clear-cache

Provide an update message when prompted, and within seconds, your users will download the fresh, bug-free JavaScript bundle the next time they open the app.


Summary

By moving your client keys to eas env, cleaning up your app.json, and respecting the Metro cache during eas update, you completely eliminate the friction of modern app deployment. You can now build, iterate, and ship OTA updates with total confidence.


[ignore keywords:
"How to set up Expo EAS from scratch"

"Expo OTA updates complete beginner guide"

"How to use environment variables in EAS build"

"Expo runtime version best practices"

"EAS build local vs cloud environment variables"

"How to trigger safe expo updates"

"React Native build production ipa and aab"

"Preventing poisoned OTA updates in Expo"
]