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
Mind that Detox works, at least officially, with the following React Native versions:
|0.68.x - 0.70.7||0.68.x - 0.70.7 -|
Visibility edge-case: see this RN issue
Newer versions, as well as React Native's "New Architecture", are most likely supported, but have not been tested out yet. Please submit an issue if you find specific problems with more recent React Native versions.
For support for React Native 0.71.x, please track this issue.
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
On the other hand, if you are fine with running Detox commands with
npx detox ..., you may skip installing
2. [MacOS Only]
This tool is required by Detox to work with iOS simulators. The recommended way to install
applesimutils is via Homebrew:
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.