Tip
If you just want to install Expo Go on a simulator or device, you do not need to build it from source. Instead, go to expo.dev/go.
To build Expo Go for development of it, follow the instructions in the section below.
If you want to contribute to the Expo SDK, use the Bare Expo app for developing and testing your changes (unless your changes are specific to the Expo Go app).
Please check with us before putting work into a Pull Request for Expo Go! The best place to talk to us is on Discord at https://chat.expo.dev.
Disclaimers:
If you want to build a standalone app that has a custom icon and name, use EAS Build. You're in the wrong place and you shouldn't need to build Expo Go from source.
If you need to make native code changes to your Expo project, such as adding custom native modules, create a development build. You're in the wrong place and you shouldn't need to build Expo Go from source.
Note: We support building Expo Go only on macOS.
- Install direnv and Homebrew.
- Clone this repo; we recommend cloning it to a directory whose full path does not include any spaces (you should clone all the submodules with
git clone --recurse-submodules). - Run
brew bundlein the root directory. - Run
yarnin the root directory. - Run
yarn setup:nativein the root directory. - Run
yarn buildin thepackages/expodirectory.
- Set up React Native
Go to the react-native-lab/react-native directory and run yarn install to install its dependencies.
You can build the React Native Android dep using ./gradlew :packages:react-native:ReactAndroid:buildCMakeDebug in react-native-lab/react-native directory. This is optional because React Native will be built anyway when you build Expo Go, but can help to narrow down a potential issue surface area.
- Run
yarn startinapps/expo-godirectory to start Metro
Metro needs to run prior running the build. Verify it runs on port 80. This is because et android-generate-dynamic-macros / et ios-generate-dynamic-macros is run during the build and needs Metro on port 80 to be running.
- Build Expo Go
For Android, run ./gradlew app:assembleDebug in the apps/expo-go/android directory.
For iOS:
- run
pod installin theapps/expo-go/iosdirectory - set
DEV_KERNEL_SOURCEtoLOCALinEXBuildConstants.plist - open and run
ios/Exponent.xcworkspacein Xcode.
- Run Metro for Native Component List
cd apps/native-component-listEXPO_SDK_VERSION=UNVERSIONED npx expo start --clear
Use the Expo Go app that you built in the previous step to scan the QR code and open the Native Component List, or hit i or a in that window to open it in Expo Go.
- If you see
error: ReferenceError: SHA-1 for file /Users/vojta/_dev/expo/react-native-lab/react-native/packages/polyfills/console.js (/Users/vojta/_dev/expo/react-native-lab/react-native/packages/polyfills/console.js) is not computed.
Potential causes:
1) You have symlinks in your project - watchman does not follow symlinks.
2) Check `blockList` in your metro.config.js and make sure it isn't excluding the file path.
run rm -rf ./react-native-lab/react-native/node_modules
- If you're seeing C++ related errors, run
find . -name ".cxx" -type d -prune -exec rm -rf '{}' +which clears.cxxbuild artifacts. Alternatively, use the "nuke" approach below. - If you get
A valid Firebase Project ID is required to communicate with Firebase server APIs., make sure you Metro is running in theapps/expo-godirectory and runet android-generate-dynamic-macros. - You might need clean the project before building it. Run
./gradlew cleanin theapps/expo-go/androiddirectory. - the "nuke" option is
git submodule foreach --recursive git clean -xfdand / orgit clean -xfdwhich removes all untracked files so you need to run the setup script./scripts/download-dependencies.shagain and building then takes a bit longer - but this approach appears to be effective.