Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot Apple queues when device not found #7473

Merged
merged 3 commits into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if [ "$target" == 'ios-device' ] || [ "$target" == 'tvos-device' ]; then

# Sign the app
/usr/bin/codesign -v --force --sign "Apple Development" --keychain "$keychain_name" --entitlements entitlements.plist "$app"
elif [[ "$targets" =~ "simulator" ]]; then
elif [[ "$target" =~ "simulator" ]]; then
# Start the simulator if it is not running already
simulator_app="$xcode_path/Contents/Developer/Applications/Simulator.app"
open -a "$simulator_app"
Expand All @@ -155,15 +155,23 @@ fi

# If we fail to find a simulator and we are not targeting a specific version (e.g. `ios-simulator_13.5`), it is probably an issue because Xcode should always have at least one runtime version inside
# 81 - simulator/device not found
if [ $exit_code -eq 81 ] && [[ "$targets" =~ "simulator" ]] && [[ ! "$targets" =~ "_" ]]; then
if [ $exit_code -eq 81 ] && [[ "$target" =~ "simulator" ]] && [[ ! "$target" =~ "_" ]]; then
touch './.retry'
touch './.reboot'
fi

# If we have a launch failure AND we are on simulators, we need to signal that we want a reboot+retry
# The script that is running this one will notice and request Helix to do it
# 83 - app launch failure
if [ $exit_code -eq 83 ] && [[ "$targets" =~ "simulator" ]]; then
if [ $exit_code -eq 83 ] && [[ "$target" =~ "simulator" ]]; then
touch './.retry'
touch './.reboot'
fi

# If we fail to find a real device, it is unexpected as device queues should have one
# It can often be fixed with a reboot
# 81 - device not found
if [ $exit_code -eq 81 ] && [[ "$target" =~ "device" ]]; then
touch './.retry'
touch './.reboot'
fi
Expand Down