Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expo-build-variants

Example app for the blog post Beta and production builds in Expo, fully local, no EAS required.

One Expo project, two completely separate apps — MyApp (production) and MyApp Beta — built locally with nothing but the Expo CLI. No EAS, no cloud builds.

What it demonstrates

  • Dynamic app config (app.config.ts) switched by APP_VARIANT at prebuild time
  • Separate application idscom.example.myapp vs com.example.myapp.beta, so both installs coexist with fully isolated storage/keychain
  • Different icons per variant — blue icon.png for production, orange icon-beta.png for beta
  • Different display names without renaming the native project, via @vanenshi/expo-plugins/display-name
  • Runtime config selected by application id, not env vars (src/config/index.ts) — production talks to jsonplaceholder.typicode.com, beta talks to dummyjson.com
  • Beta-only UI — a Debug tab and a "debug tools" button that only exist in the beta build

Requirements

  • Node 20.19.4+ (Expo SDK 57)
  • Xcode / Android Studio for the respective platforms

Run it

pnpm install

# beta variant (default)
npm run prebuild
npm run ios          # or: npm run android

# production variant
npm run prebuild:prod
npm run ios          # or: npm run android

Install both on the same simulator/device and you'll see two apps side by side: MyApp (blue) and MyApp Beta (orange).

Release artifacts

Local EAS builds (no cloud queue — --local runs on your machine):

npm run ios:beta:build       # eas build -e beta -p ios --local
npm run ios:prod:build
npm run android:beta:build
npm run android:prod:build

Or skip EAS entirely: prebuild, then cd android && ./gradlew assembleRelease, or archive ios/MyApp.xcworkspace from Xcode.

How it works

Read the full write-up in the blog post. Short version: android/ and ios/ are gitignored generated output (Continuous Native Generation). npx expo prebuild --clean regenerates them as the beta app (the default); APP_VARIANT=prod gives you production. At runtime the app asks the OS who it is via Application.applicationId and picks its config from that — no env files anywhere.

License

MIT

About

Beta and production build variants in Expo, fully local, no EAS — example app for blog post

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages