Skip to main content
Version: 20.x

Environment Setup

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:

Note

Mind that Detox works, at least officially, with the following React Native versions:

iOSAndroid
0.68.x - 0.70.70.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.

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.

Detox Prerequisites​

To complete the environment setup, you still have 2 steps ahead: installing detox-cli and applesimutils.

1. Command Line Tools (detox-cli)​

detox-cli is merely a script that passes commands through to a local Detox executable located at node_modules/.bin/detox, 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

On the other hand, if you are fine with running Detox commands with npx detox ..., you may skip installing detox-cli.

2. [MacOS Only] applesimutils​

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
Note

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.