Skip to content

Commit 32c4dc2

Browse files
committed
add script scheme catch
1 parent 048a064 commit 32c4dc2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scripts/zip_quickstart_test.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,23 @@ else
4242
device_name="iPhone 16"
4343
fi
4444

45+
# Define project and scheme names
46+
PROJECT_NAME="${SAMPLE}Example.xcodeproj"
47+
SCHEME_NAME="${SAMPLE}Example${SWIFT_SUFFIX}"
48+
49+
# Check if the scheme exists before attempting to build.
50+
# The `awk` command prints all lines from "Schemes:" to the end of the output.
51+
if ! xcodebuild -list -project "${PROJECT_NAME}" | awk '/Schemes:/,0' | grep -q "^\s*${SCHEME_NAME}"$; then
52+
echo "Error: Scheme '${SCHEME_NAME}' not found in project '${PROJECT_NAME}'."
53+
echo "Available schemes from '${PROJECT_NAME}':"
54+
xcodebuild -list -project "${PROJECT_NAME}"
55+
exit 65
56+
fi
57+
4558
(
4659
xcodebuild \
47-
-project ${SAMPLE}Example.xcodeproj \
48-
-scheme ${SAMPLE}Example${SWIFT_SUFFIX} \
60+
-project ${PROJECT_NAME} \
61+
-scheme ${SCHEME_NAME} \
4962
-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' \
5063
build \
5164
) || EXIT_STATUS=$?

0 commit comments

Comments
 (0)