Skip to content

Commit

Permalink
Set device name based on Xcode version in zip_quickstart_test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard committed Nov 12, 2024
1 parent 24c0925 commit c1952b8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/zip_quickstart_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,23 @@ if [[ ! -z "$LEGACY" ]]; then
cd "Legacy${SAMPLE}Quickstart"
fi

xcode_version=$(xcodebuild -version | grep Xcode)
xcode_version="${xcode_version/Xcode /}"
xcode_major="${xcode_version/.*/}"

if [[ "$xcode_major" -lt 15 ]]; then
device_name="iPhone 14"
elif [[ "$xcode_major" -lt 16 ]]; then
device_name="iPhone 15"
else
device_name="iPhone 16"
fi

(
xcodebuild \
-project ${SAMPLE}Example.xcodeproj \
-scheme ${SAMPLE}Example${SWIFT_SUFFIX} \
-destination 'platform=iOS Simulator,name=iPhone 14' "SWIFT_VERSION=5.3" "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase' \
-destination "platform=iOS Simulator,name=$device_name" "SWIFT_VERSION=5.3" "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase' \
build \
) || EXIT_STATUS=$?

Expand Down

0 comments on commit c1952b8

Please sign in to comment.