Skip to content

Commit 9b58867

Browse files
committed
add build yaml device log
1 parent 9c81f84 commit 9b58867

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/ios.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ jobs:
4545
platform: ${{ 'iOS Simulator' }}
4646
run: |
4747
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
48-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
48+
device=$(xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//")
4949
echo "Selected device: $device"
5050
os=$(xcrun simctl list devices | grep "$device (" | grep -oE 'iOS [0-9.]+' | sort -V | tail -1 | cut -d" " -f2)
5151
echo "Selected OS: $os"
52+
if [ -z "$os" ]; then
53+
echo "Failed to detect iOS version for device: $device"
54+
exit 1
55+
fi
5256
if [ $scheme = default ]; then scheme=$(cat default); fi
5357
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
5458
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`

0 commit comments

Comments
 (0)