IMPORTANT: Get your environment properly set up, as explained in our contribution guide.
Be sure to set up either an iOS simulator or a proper Android AVD emulator matching the Detox configurations of the project (devices
section of the detox.config.js
file).
Prebuild Detox as an Android archive (a .aar
file), locally:
cd detox
npm run build:android
On success, the result is a set of maven artifacts published in subdirectories under
detox/Detox-android/
. That includesdetox-999.999.999.aar
(i.e. Detox' native code packaged with the fake version999.999.999
).
Install the necessary pods:
cd detox
npm run podInstall:ios
Build the demo project using one of the npm
scripts.
npm run build:ios-release
-or-
npm run build:android-release
npm run test:ios-release
-or-
npm run test:android-release
The project’s tests can also be executed with the app running in debug mode (mainly, with JavaScript code getting bundled on-the-fly using the metro
server).
For that, first run the metro
server:
npm start
then follow the same instructions specified for Release mode, above, using associated debug
scripts instead of the release
ones. Namely -
Build:
npm run build:ios-debug
-or-
npm run build:android-debug
Test:
npm run test:ios-debug
-or-
npm run test:android-debug