mirror of
https://github.com/actions/runner-images.git
synced 2026-01-07 18:58:13 +08:00
[macOS] Implement new directories hierarchy (#8741)
This commit is contained in:
committed by
GitHub
parent
5d40b1e213
commit
8d6a01b370
30
images/macos/scripts/build/xcode-postbuild.sh
Normal file
30
images/macos/scripts/build/xcode-postbuild.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
|
||||
source ~/utils/utils.sh
|
||||
XCODE_LIST=($(get_toolset_value '.xcode.versions | reverse | .[].link'))
|
||||
DEFAULT_XCODE_VERSION=$(get_toolset_value '.xcode.default')
|
||||
|
||||
# https://github.com/microsoft/appcenter/issues/847
|
||||
# Assets.xcassets : error : CoreData: error: (6922) I/O error for database
|
||||
# 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
|
||||
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"
|
||||
|
||||
# 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"
|
||||
Reference in New Issue
Block a user