npx expo start can open your project in two different apps on a phone, Expo Go or a development build of your own app. It can also bundle the JavaScript in development mode or in production mode. The app decides which libraries your project can use, and the mode decides how close what you see is to what your users will run.
Key terms
- Expo Go: Expo's playground app for trying Expo quickly, with a fixed set of native libraries built in.
- Development build: a debug build of your own app that contains the
expo-dev-clientlibrary. - Launch target: the app that
npx expo startopens the project in, Expo Go or a development build. - Production mode: the mode published projects and standalone apps run in, where Metro sets
__DEV__tofalse.
Where Expo Go stops
Expo Go ships a fixed set of native libraries, so you write only JavaScript and never build a native app yourself. It runs the Expo SDK libraries and libraries that need no custom native code, with exceptions: expo-observe, for one, is not available in Expo Go. Some third-party libraries with native code are built in too, such as react-native-webview. It can't run a library whose native code isn't already built into Expo Go, and you can't edit native code in it. Install such a library anyway and its JavaScript loads, then errors right away, because the native code it calls doesn't exist in Expo Go.
Expo Go can't be changed after it is installed, so adding native libraries or changing the app's name and icon needs a development build. A few features are out of reach: remote push notifications (in-app notifications work), and Android App Links and iOS Universal Links, which need the website's URL inside the native app. Each Expo Go build supports one SDK version, and it must match the project's. Expo describes Expo Go as a limited playground that isn't meant for production-grade projects and recommends development builds for apps headed to the stores.
Signing in on a physical iOS device
On a physical iOS device, Expo Go opens a project from your dev server only when Expo CLI and Expo Go are signed in to the same Expo account. When neither is signed in, the device shows You need to be signed in to Expo Go and Expo CLI to open your project. Expo CLI prints no warning about it, so the device is the only place you see the problem. Android devices, the Android Emulator, the iOS Simulator and published updates don't have this check.
To fix it, sign in to Expo CLI with npx expo login and to Expo Go with the account icon in its top-right corner, and use npx expo whoami to see which account the CLI uses. After signing in, pressing Try Again is enough, because Expo CLI reads credentials on each Expo Go request. Switching to a different account is the exception: the CLI caches the account for the life of the process, so restart the dev server.
Choosing the launch target
Without a flag, npx expo start launches a development build when expo-dev-client is listed in dependencies or devDependencies in package.json, and Expo Go otherwise. Two flags override that choice: --go (-g) always launches in Expo Go, and --dev-client (-d) always launches in a development build. Passing both is an error. While the server runs, pressing S in the Terminal UI switches the launch target between Expo Go and development builds.
A separate set of flags decides where the app opens as the server starts: --android (-a) on a connected Android device, --ios (-i) in an iOS simulator and --web (-w) in a web browser. The template's android, ios and web scripts are these flags. The commands in the launch and mode example combine both sets.
Development and production mode
By default, npx expo start runs your JavaScript in development mode. It adds warnings and debugging tools, and runs validations that warn about things like deprecated or missing required properties. The app also runs slower in development mode.
npx expo start --no-dev --minify simulates how the project runs on your users' devices. --no-dev bundles in production mode, where Metro sets __DEV__ to false, and --minify strips comments, formatting and unused code. They are separate options: --no-dev alone turns development mode off without minifying, and minification happens only when you pass --minify. Turn development mode off whenever you measure performance.
Console logs no longer appear in the Expo CLI terminal in production mode, so a missing log doesn't mean the code didn't run. After switching modes, close and reopen the app.
Code Examples
# expo-dev-client is in package.json, so this opens the development build
npx expo start
# Open this session in Expo Go instead
npx expo start --go
# Always use the development build, and open it on a connected Android device
npx expo start --dev-client --android
# Production mode with minified JavaScript, as on users' devices
npx expo start --no-dev --minify