Skip to content

Commit d2f2b11

Browse files
committed
fix(ci): select available iOS simulator for detox
Assisted-By: devx/19751835-7576-443a-b467-a2c2c64d8935
1 parent 882ba64 commit d2f2b11

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/flash-list.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ jobs:
204204
yarn
205205
cd ios
206206
bundle exec pod install
207+
- name: Select iOS simulator
208+
run: |
209+
xcrun simctl list devices available
210+
DETOX_IOS_DEVICE_TYPE=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ { name=$1; sub(/^[[:space:]]*/, "", name); sub(/[[:space:]]*$/, "", name); print name; exit }')
211+
if [ -z "$DETOX_IOS_DEVICE_TYPE" ]; then
212+
echo "No available iPhone simulator found" >&2
213+
exit 1
214+
fi
215+
echo "Using iOS simulator: $DETOX_IOS_DEVICE_TYPE"
216+
echo "DETOX_IOS_DEVICE_TYPE=$DETOX_IOS_DEVICE_TYPE" >> "$GITHUB_ENV"
207217
- name: Build and Run e2e tests
208218
run: |
209219
cd fixture/react-native

fixture/react-native/.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
simulator: {
3131
type: "ios.simulator",
3232
device: {
33-
type: "iPhone 16 Pro",
33+
type: process.env.DETOX_IOS_DEVICE_TYPE || "iPhone 16 Pro",
3434
},
3535
},
3636
emulator: {

0 commit comments

Comments
 (0)