Files
runner-images/images/macos/scripts/build/configure-xcode.sh
T

35 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash -e -o pipefail
2023-11-28 02:25:03 +01:00
################################################################################
## File: configure-xcode.sh
## Desc: Configure Xcode after installation
################################################################################
2020-09-10 14:34:08 +03:00
source ~/utils/utils.sh
2020-11-02 22:05:52 +03:00
XCODE_LIST=($(get_toolset_value '.xcode.versions | reverse | .[].link'))
2020-11-02 18:03:20 +03:00
DEFAULT_XCODE_VERSION=$(get_toolset_value '.xcode.default')
2020-09-10 14:34:08 +03:00
# https://github.com/microsoft/appcenter/issues/847
# Assets.xcassets : error : CoreData: error: (6922) I/O error for database
2020-09-10 14:34:08 +03:00
# at $HOME/Library/Developer/Xcode/UserData/IB Support/Simulator Devices/{GUID}
echo "Erase a device's contents and settings:"
for XCODE_VERSION in ${XCODE_LIST[@]}; do
2020-09-10 14:34:08 +03:00
echo " Xcode Version: ${XCODE_VERSION}"
launchctl remove com.apple.CoreSimulator.CoreSimulatorService || true
#add sleep to let CoreSimulatorService to exit
sleep 3
# Select xcode version by default
sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer
2020-09-10 14:34:08 +03:00
# Erase a device's contents and settings
xcrun simctl erase all
#add sleep due to sometimes "xcrun simctl list" takes more than a few moments and script fails when trying to remove CoreSimulatorSerivce
sleep 10
done
# Select xcode version by default
echo "Setting Xcode ${DEFAULT_XCODE_VERSION} as default"
sudo xcode-select -s /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app/Contents/Developer