Edit this page
Learn about different tools available to inspect your Expo project at runtime.
React Native consists of both JavaScript and native code. Making this distinction is very important when it comes to debugging. If an error is thrown from the JavaScript code, you might not find it using debugging tools for native code. This page lists a few tools to help you debug your Expo project.
The Developer menu provides access to useful debugging functions. It is built into dev clients and Expo Go. If you are using an emulator, simulator, or have a device connected via USB, you can open this menu by pressing m in the terminal where Expo CLI has started the development server.
Once the Developer menu is open, it will appear as below:
The Developer menu provides the following options:
exp://
link in Expo of your app.Now, let's explore some of these options in details.
Opens up a small overlay that provides the following performance information about your app:
Opens up the element inspector overlay:
This overlay has capabilities to:
As with websites, you can use Chrome DevTools to gain insights into the JavaScript code of your app. With this tool, you can access the Console, Source, and Network tab when using dev clients or Expo Go.
You can use the Chrome DevTools on any app using Hermes. To open it, start your app and press j in the terminal where Expo was started. Once you have opened the Chrome DevTools, it will appear as below:
You can pause your app on specific parts of your code. To do this, set the breakpoint under the Sources tab by clicking the line number, or add the debugger
statement in your code.
Once your app is executing code that has a breakpoint, it will entirely pause your app. This allows you to inspect all variables and functions in that scope. You can also execute code in the Console tab as part of your app.
Breakpoints set through the Chrome DevTools depend heavily on source maps. Unfortunately, these source maps are not always 100% accurate. In some cases, you might have to use adebugger
statement instead of a breakpoint.
If your app throws unexpected errors, it can be hard to find the source of the error. You can use Chrome DevTools to pause your app and inspect the stack trace and variables the moment it throws an error.
Some errors might be caught by other components in your app, such as Expo Router. In these cases, you can turn on Pause on caught exceptions. It will enable you to inspect any thrown error, even when handled properly.
The Console tab gives you access to an interactive terminal, connected directly to your app. You can write any JavaScript inside this terminal to execute snippets of code as if it were part of your app. The code is executed in the global scope by default. But, when using breakpoints from the Source tab, it executes in the scope of the reached breakpoint. This allows you to invoke methods and access variables throughout your app.
The Network tab gives you insights into the network requests made by your app. You can inspect each request and response by clicking on them. This includes fetch
requests, external loaded media, and in some cases, even requests made by native modules.
See the Inspecting network traffic for alternative ways to inspect network requests.
Profiles are not yet symbolicated with sourcemaps, and can only be used in debug builds. These limitations will be addressed in upcoming releases.
You can enable the JavaScript Profiler tab within Chrome DevTools to record and analyze the performance of your app JavaScript. The Performance tab is not currently supported. To profile the native runtime, use the tools included in Android Studio or Xcode.
VS Code debugger integration is experimental. For the most stable debugging experience, use the Chrome DevTools built into Expo CLI.
VS Code is a popular code editor, which has a built-in debugger. This debugger uses the same system as the Chrome DevTools — the inspector protocol.
You can use this debugger with the Expo Tools VS Code extension. This debugger allows you to set breakpoints, inspect variables, and execute code through the debug console.
To start debugging:
This will attach VS Code to your running app.
React DevTools is a great way to look at your components' props and state. You can open it by pressing Shift + m in the terminal where Expo was started. Once it's open, it will appear as below:
React DevTools can also be paired with the element inspector, allowing you to inspect props, state, and instance properties by tapping components inside your app.
Pressing the shift + m shortcut will also show installed dev tools plugins to provide additional ways to inspect your app.
The React Native Debugger requires Remote JS debugging, which has been deprecated since React Native 0.73.
The React Native Debugger is a standalone app that wraps the React DevTools, Redux DevTools, and the Chrome DevTools. Unfortunately, it requires the deprecated Remote JS debugging workflow and is incompatible with Hermes.
If you are using Expo SDK 50 or above, you can use the Expo dev tools plugins equivalents to the React Native Debugger:
If you are using Expo SDK 49 or below, you can use the React Native Debugger. This section provides quick get started instructions. For in-depth information, check its documentation.
You can install it via the release page, or if you're on macOS you can run:
-
brew install react-native-debugger
After firing up React Native Debugger, you'll need to specify the port (shortcuts: Cmd ⌘ + t on macOS, Ctrl + t on Linux/Windows) to 8081
. After that, run your project with npx expo start
, and select Debug remote JS
from the Developer Menu. The debugger should automatically connect.
In the debugger console, you can see the Element tree, as well as the props, state, and children of whatever element you select. You also have the Chrome console on the right, and if you type $r
in the console, you will see the breakdown of your selected element.
If you right-click anywhere in the React Native Debugger, you'll get some handy shortcuts to reload your JS, enable/disable the element inspector, network inspector, and to log and clear your AsyncStorage
content.
It's easy to use the React Native Debugger to debug your network request: right-click anywhere in the React Native Debugger and select Enable Network Inspect
. This will enable the Network tab and allow you to inspect requests of fetch
and XMLHttpRequest
.
There are however some limitations, so there are a few other alternatives, all of which require using a proxy:
In reality, apps often ship with bugs. Implementing a crash and bug reporting system can help you get real-time insights of your production apps. See Using error reporting services for more details.