22# run-tests.sh - set up devices, build the example app, and run Maestro flows.
33#
44# Usage:
5- # ./run-tests.sh --platform <ios|android> [--update-screenshots] [--rebuild] [--shards N] [--release] [ flow ...]
5+ # ./run-tests.sh --platform <ios|android> [--update-screenshots] [--rebuild] [--shards N] [flow ...]
66#
77# Options:
88# --platform Required. Target platform: ios or android.
1212# --shards N Number of devices to boot and split flows across
1313# (default 1). Automatically clamped to the number of
1414# flows being run.
15- # --release Build the example app in Release mode. Faster app
16- # launches (no Metro), at the cost of a slower build.
1715# flow ... One or more Maestro flow files or directories to run.
1816# Defaults to all component suites if omitted.
1917#
@@ -48,7 +46,6 @@ EXAMPLE_DIR="$REPO_ROOT/apps/example"
4846PLATFORM=" "
4947UPDATE_SCREENSHOTS=" "
5048REBUILD=" "
51- RELEASE=" "
5249SHARDS=1
5350FLOWS=" "
5451
@@ -57,7 +54,6 @@ while [ $# -gt 0 ]; do
5754 --platform) PLATFORM=" $2 " ; shift 2 ;;
5855 --update-screenshots) UPDATE_SCREENSHOTS=" true" ; shift ;;
5956 --rebuild) REBUILD=" true" ; shift ;;
60- --release) RELEASE=" true" ; shift ;;
6157 --shards) SHARDS=" $2 " ; shift 2 ;;
6258 * ) FLOWS=" ${FLOWS: +$FLOWS } $1 " ; shift ;;
6359 esac
@@ -129,21 +125,13 @@ set_font_scale() {
129125# in a scaled-up state.
130126trap ' set_font_scale default' EXIT
131127
132- if [ -n " $RELEASE " ]; then
133- IOS_MODE=" Release"
134- ANDROID_MODE=" release"
135- else
136- IOS_MODE=" Debug"
137- ANDROID_MODE=" debug"
138- fi
139-
140128# Builds and installs on the given device via the react-native CLI.
141129build_and_install () {
142130 local dev=" $1 "
143131 if [ " $PLATFORM " = ios ]; then
144- yarn example ios --udid " $dev " --mode " $IOS_MODE "
132+ yarn example ios --udid " $dev "
145133 else
146- yarn example android --device " $dev " --mode " $ANDROID_MODE "
134+ yarn example android --device " $dev "
147135 fi
148136}
149137
@@ -153,7 +141,7 @@ build_and_install() {
153141install_prebuilt () {
154142 local dev=" $1 " app_path apk_path
155143 if [ " $PLATFORM " = ios ]; then
156- app_path=$( ls -td " $EXAMPLE_DIR /ios/build/Build/Products/${IOS_MODE} -iphonesimulator" /* .app 2> /dev/null | head -1 || true)
144+ app_path=$( ls -td " $EXAMPLE_DIR /ios/build/Build/Products/Debug -iphonesimulator" /* .app 2> /dev/null | head -1 || true)
157145 if [ -z " $app_path " ]; then
158146 app_path=$( xcrun simctl get_app_container " $DEVICE_ID " " $BUNDLE_ID " app 2> /dev/null || true)
159147 fi
@@ -165,7 +153,7 @@ install_prebuilt() {
165153 build_and_install " $dev "
166154 fi
167155 else
168- apk_path=$( ls -t " $EXAMPLE_DIR /android/app/build/outputs/apk/${ANDROID_MODE} " /* .apk 2> /dev/null | head -1 || true)
156+ apk_path=$( ls -t " $EXAMPLE_DIR /android/app/build/outputs/apk/debug " /* .apk 2> /dev/null | head -1 || true)
169157 if [ -z " $apk_path " ]; then
170158 local device_apk
171159 device_apk=$( adb -s " $DEVICE_ID " shell pm path " $BUNDLE_ID " 2> /dev/null | head -1 | cut -d: -f2 | tr -d ' \r' || true)
0 commit comments