Skip to content

Commit 3ec17ec

Browse files
Update tests.sh
1 parent 0980ef0 commit 3ec17ec

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/scripts/tests.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/bin/bash
22

33
ARCH=""
4-
5-
if [ $1 = "arm" ]
6-
then
4+
5+
if [ "$1" = "arm" ]; then
76
ARCH="arm64"
87
else
98
ARCH="x86_64"
@@ -13,9 +12,18 @@ echo "Building with arch: ${ARCH}"
1312

1413
export LC_CTYPE=en_US.UTF-8
1514

15+
DEVICE_ID=$(xcrun xctrace list devices 2>/dev/null | grep -m1 "My Mac" | grep "${ARCH}" | awk -F '[()]' '{print $2}')
16+
17+
if [ -z "$DEVICE_ID" ]; then
18+
echo "Failed to find device ID for arch ${ARCH}"
19+
exit 1
20+
fi
21+
22+
echo "Using device ID: $DEVICE_ID"
23+
1624
set -o pipefail && arch -"${ARCH}" xcodebuild \
1725
-scheme CodeEditSourceEditor \
1826
-derivedDataPath ".build" \
19-
-destination "platform=macos,arch=${ARCH},name=My Mac" \
27+
-destination "id=${DEVICE_ID}" \
2028
-skipPackagePluginValidation \
2129
clean test | xcpretty

0 commit comments

Comments
 (0)