title | sidebar_title | description |
---|---|---|
Install expo-dev-client in a bare React Native project |
Install expo-dev-client |
Learn how to install and configure expo-dev-client in bare React Native projects. |
import { Terminal } from '/ui/components/Snippet';
import { Step } from '/ui/components/Step';
import ImageSpotlight from '/components/plugins/ImageSpotlight';
import { Collapsible } from '/ui/components/Collapsible';
The following guide explains how to install and configure expo-dev-client
in an existing React Native project.
If you're starting a project, you can create a new project with the with-dev-client
template. Run this command to initialize the project:
<Terminal cmd={['$ npx create-expo-app -e with-dev-client']} />
You may be reading the wrong guide then! To use expo-dev-client
in a project that uses CNG, see "Create a development build".
The expo
package must be installed and configured: if you created your project with npx react-native init
and do not have any other Expo packages installed, you will need to install Expo modules before proceeding.
Add the expo-dev-client
library to your package.json:
<Terminal cmd={['$ npx expo install expo-dev-client']} />
If your project has an ios/ directory on disk, run the following command to fully install the native code for expo-dev-client
:
<Terminal cmd={['$ npx pod-install']} />
If your project doesn't have an ios/ directory, you can skip this step.
Expo CLI uses a deep link to launch your project, and it's also useful if you use plan to use expo-dev-client
for launching preview updates if you have added a custom deep link scheme to your project. If you haven't configured a scheme
for your app yet to support deep linking, then you can use uri-scheme
package to do this for you.
<Terminal cmd={[ "# List your project's schemes", '$ npx uri-scheme list', '', '# Add a scheme to your project', '$ npx uri-scheme add ', ]} />
For more information, see uri-scheme package.
For certain type of errors, you can provide more helpful error messages. To turn this on, import expo-dev-client
in the project's index file (in the managed workflow, you need to add this import on top of the App.{js|tsx}). Make sure that the import statement is above import App from './App'
.
import 'expo-dev-client';
...
import App from "./App";
For more information, see Error handling.
Create a debug build of your app using the tools of your choice. For example, you can do this locally with Expo CLI or in the cloud with EAS Build.