Skip to content

Commit 6e4680d

Browse files
committed
Improve simulator discoverability
1 parent 09bdb64 commit 6e4680d

6 files changed

Lines changed: 71 additions & 19 deletions

File tree

sample/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
66
gem 'cocoapods', '1.16.2'
77
gem 'cocoapods-check', '1.1.0'
88
gem 'activesupport', '>= 6.1.7.5', '< 7.3.0'
9+
gem 'xcpretty'

sample/Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ GEM
9292
nkf (0.2.0)
9393
public_suffix (4.0.7)
9494
rexml (3.4.1)
95+
rouge (3.28.0)
9596
ruby-macho (2.5.1)
9697
securerandom (0.4.1)
9798
typhoeus (1.4.1)
@@ -105,6 +106,8 @@ GEM
105106
colored2 (~> 3.1)
106107
nanaimo (~> 0.4.0)
107108
rexml (>= 3.3.6, < 4.0)
109+
xcpretty (0.4.1)
110+
rouge (~> 3.28.0)
108111

109112
PLATFORMS
110113
ruby
@@ -113,6 +116,7 @@ DEPENDENCIES
113116
activesupport (>= 6.1.7.5, < 7.3.0)
114117
cocoapods (= 1.16.2)
115118
cocoapods-check (= 1.1.0)
119+
xcpretty
116120

117121
RUBY VERSION
118122
ruby 3.1.2p20

sample/ios/Podfile.lock

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -935,9 +935,9 @@ PODS:
935935
- React-Mapbuffer (0.74.1):
936936
- glog
937937
- React-debug
938-
- react-native-config (1.5.3):
939-
- react-native-config/App (= 1.5.3)
940-
- react-native-config/App (1.5.3):
938+
- react-native-config (1.5.5):
939+
- react-native-config/App (= 1.5.5)
940+
- react-native-config/App (1.5.5):
941941
- React-Core
942942
- react-native-safe-area-context (4.14.0):
943943
- React-Core
@@ -1170,8 +1170,27 @@ PODS:
11701170
- React-logger (= 0.74.1)
11711171
- React-perflogger (= 0.74.1)
11721172
- React-utils (= 0.74.1)
1173-
- RNCMaskedView (0.3.1):
1173+
- RNCMaskedView (0.3.2):
1174+
- DoubleConversion
1175+
- glog
1176+
- hermes-engine
1177+
- RCT-Folly (= 2024.01.01.00)
1178+
- RCTRequired
1179+
- RCTTypeSafety
1180+
- React-Codegen
11741181
- React-Core
1182+
- React-debug
1183+
- React-Fabric
1184+
- React-featureflags
1185+
- React-graphics
1186+
- React-ImageManager
1187+
- React-NativeModulesApple
1188+
- React-RCTFabric
1189+
- React-rendererdebug
1190+
- React-utils
1191+
- ReactCommon/turbomodule/bridging
1192+
- ReactCommon/turbomodule/core
1193+
- Yoga
11751194
- RNGestureHandler (2.15.0):
11761195
- DoubleConversion
11771196
- glog
@@ -1302,7 +1321,7 @@ PODS:
13021321
- ReactCommon/turbomodule/bridging
13031322
- ReactCommon/turbomodule/core
13041323
- Yoga
1305-
- RNShopifyCheckoutSheetKit (3.1.2):
1324+
- RNShopifyCheckoutSheetKit (3.2.0):
13061325
- React-Core
13071326
- ShopifyCheckoutSheetKit (~> 3.1.2)
13081327
- RNVectorIcons (10.2.0):
@@ -1562,7 +1581,7 @@ SPEC CHECKSUMS:
15621581
React-jsitracing: dd0e541a34027b3ab668ad94cf268482ad6f82fb
15631582
React-logger: 6070f362a1657bb53335eb1fc903d3f49fd79842
15641583
React-Mapbuffer: 2c95cbabc3d75a17747452381e998c35208ea3ee
1565-
react-native-config: ea75335a7cca1d3326de1da384227e580a7c082e
1584+
react-native-config: 644074ab88db883fcfaa584f03520ec29589d7df
15661585
react-native-safe-area-context: b13be9714d9771fbde0120bc519c963484de3a71
15671586
React-nativeconfig: b0073a590774e8b35192fead188a36d1dca23dec
15681587
React-NativeModulesApple: 61b07ab32af3ea4910ba553932c0a779e853c082
@@ -1587,11 +1606,11 @@ SPEC CHECKSUMS:
15871606
React-runtimescheduler: 87b14969bb0b10538014fb8407d472f9904bc8cd
15881607
React-utils: 67574b07bff4429fd6c4d43a7fad8254d814ee20
15891608
ReactCommon: 64c64f4ae1f2debe3fab1800e00cb8466a4477b7
1590-
RNCMaskedView: de80352547bd4f0d607bf6bab363d826822bd126
1609+
RNCMaskedView: af7c1703f39cdef08a99275bfcadf324aa403403
15911610
RNGestureHandler: 293aea360e79439e2272b8a5ffebd582a1e4c486
15921611
RNReanimated: af5545657216ca1794252c132f9e6e8ceb475462
15931612
RNScreens: 02747ebee17d2e322af4ee383877367cf82a3cd6
1594-
RNShopifyCheckoutSheetKit: 26cb201d8ef66263aaec45c2bfa9649606576a2a
1613+
RNShopifyCheckoutSheetKit: 3c10482e626a3e2579e729e61becef5cca3af859
15951614
RNVectorIcons: 6c795cacc9276decc31d8e1a139b9cc6fc0479ca
15961615
ShopifyCheckoutSheetKit: 5ae02dbed0047689b94c977bdcf6287752d17ce4
15971616
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
@@ -1600,4 +1619,4 @@ SPEC CHECKSUMS:
16001619

16011620
PODFILE CHECKSUM: 9efd19a381198fb46f36acf3d269233039fb9dc5
16021621

1603-
COCOAPODS: 1.16.1
1622+
COCOAPODS: 1.16.2

sample/scripts/build_ios

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
set -ex
44
set -eo pipefail
55

6-
if [[ -n $CURRENT_SIMULATOR_UUID ]]; then
7-
dest="id=$CURRENT_SIMULATOR_UUID"
8-
else
9-
dest="platform=iOS Simulator,name=iPhone 15 Pro"
10-
fi
6+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
source "$SCRIPT_DIR/simulator"
8+
dest="$(get_sim_destination)"
119

1210
cd ios
1311

sample/scripts/simulator

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
# Determine an iOS Simulator destination string for xcodebuild.
4+
get_sim_destination() {
5+
if [[ -n "$CURRENT_SIMULATOR_UUID" ]]; then
6+
echo "id=$CURRENT_SIMULATOR_UUID"
7+
return
8+
fi
9+
10+
# Prefer a currently booted iOS simulator (iPhone or iPad)
11+
local udid
12+
udid="$(xcrun simctl list devices booted \
13+
| grep -E 'iPhone|iPad' \
14+
| sed -n -E 's/.*\(([0-9A-Fa-f-]{36})\).*/\1/p' \
15+
| head -n1)"
16+
17+
# If none booted, pick the first available iOS simulator (iPhone or iPad)
18+
if [[ -z "$udid" ]]; then
19+
udid="$(xcrun simctl list devices available \
20+
| grep -E 'iPhone|iPad' \
21+
| sed -n -E 's/.*\(([0-9A-Fa-f-]{36})\).*/\1/p' \
22+
| head -n1)"
23+
fi
24+
25+
if [[ -n "$udid" ]]; then
26+
echo "id=$udid"
27+
else
28+
echo "platform=iOS Simulator,name=iPhone 15 Pro"
29+
fi
30+
}
31+
32+

sample/scripts/test_ios

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
set -ex
44
set -eo pipefail
55

6-
if [[ -n $CURRENT_SIMULATOR_UUID ]]; then
7-
dest="id=$CURRENT_SIMULATOR_UUID"
8-
else
9-
dest="platform=iOS Simulator,name=iPhone 15 Pro"
10-
fi
6+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7+
source "$SCRIPT_DIR/simulator"
8+
dest="$(get_sim_destination)"
119

1210
cd ios
1311

0 commit comments

Comments
 (0)