Welcome to Detox!
The Introduction section walks you through setting up Detox in your project, one step at a time.
You will find that some steps are longer than the others: some are a couple of paragraphs, while the others look like a dedicated multistep guide. Bear with us - it is all necessary, and once set up, it is easy to move forward with writing tests at a high pace.
Please select type of your mobile application before you start the tutorial:
- React Native
Detox was built from the ground up to support "classic" React Native projects.
While Detox should work out of the box with almost any React Native version from the past few minor releases, official support is provided for React Native versions
0.71.x without React Native's "New Architecture".
Newer versions, as well as React Native's "New Architecture", may work with Detox, but have not been tested out yet by the Detox team.
Although we do not officially support older React Native versions, we do our best to keep Detox compatible with them.
Expo integration with Detox is entirely a community-driven effort. There is no special support for Expo projects in Detox, and we do not maintain any Expo-specific code or documentation.
There is a tutorial on how to set up Detox with Expo projects, which you can find on Expo official documentation site: Running E2E tests on EAS Build. It is a great starting point for projects that are using Expo.
For support on how to use Detox with Expo, you should contact the Expo team or the Expo community.
If you are experiencing a bug, which you believe is a Detox issue, please open an issue on our GitHub repository.
At the moment, Detox does not support non-React Native apps on Android due to the blocking issues:
However, native iOS apps are expected to work fine with Detox, and if that's your case, this introduction will help you in equal measure.
React Native CLI Quickstart
Your first step would be to complete the 📚 React Native CLI Quickstart Guide.
Open the link above and switch there to React Native CLI Quickstart tab to see the interactive tutorial for Development OS and Target OS of your choice.
Follow all the steps (yes, even if you have a native app!) and make sure you can create and run React Native apps on virtual testing devices.
To complete the environment setup, you still have 2 steps ahead: installing
1. Command Line Tools (
detox-cli is merely a script that passes commands through to
a local Detox executable located at
making it easier to operate Detox from the command line, e.g.
detox test -c ios.sim.debug.
It should be installed globally, enabling usage of the command line tools outside your npm scripts:
npm install detox-cli --global
yarn global add detox-cli
pnpm add detox-cli --global
On the other hand, if you are fine with running Detox commands with
npx detox ..., you may skip installing
2. [MacOS Only]
brew tap wix/brew
brew install applesimutils
Make sure to periodically update your version of
applesimutils to the latest version.
Now, when your environment is ready, let's move to the next section, Project Setup.