forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 3
RNTester Detox Android Setup
Yash Kumar Verma edited this page Jul 10, 2020
·
5 revisions
- Move to the RNTester directory
/packages/RNTester
- Run
yarn install
in the directory.
- Make sure you have a emulator running. Check out this link for steps on creating and running an emulator using android studio.
- Edit the
.detoxrc.json
and insert your AVD name in place of YOUR_AVD_NAME. - Run
detox build -c android.emu.debug
- Run
detox test -c android.emu.debug
- Make sure your device is running Android 5.0 (Lollipop) or newer and has USB debugging enabled, and it is connected via USB to your development machine.
- Run the command
adb devices
to see the list of all available devices. - Run
adb -s $YOUR_DEVICE_NAME reverse tcp:8081 tcp:8081
(replace $YOUR_DEVICE_NAME with the name you see in the list of connected devices after executing previous step) - Edit the
.detoxrc.json
and insert your DEVICE name in place of YOUR_DEVICE_NAME. - Run
detox build -c android.emu.debug
- Run
detox test -c android.emu.debug
Note - If you see some ERROR security exception INSTALL_GRANT_RUNTIME_PERMISSIONS while executing 8th step, change the connected device you are using (Some chinese company(MI, Oppo etc) phones do not support it)
The above tasks can be done using the https://github.com/YashKumarVerma/react-native-shots script.