diff --git a/system-dependencies.sh b/system-dependencies.sh index ee3c1a753d..84740383e0 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -164,13 +164,14 @@ COLOR_RED=$(tput setaf 1 2>/dev/null || true) COLOR_ORANGE=$(tput setaf 3 2>/dev/null || true) COLOR_MAGENTA=$(tput setaf 5 2>/dev/null || true) COLOR_CLEAR=$(tput sgr0 2>/dev/null || true) +COLOR_RESET=uniquesearchablestring function fail () { - echo " ${COLOR_RED}$1${COLOR_CLEAR}" + echo " ${COLOR_RED}${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" FAIL=1 } function warn () { - echo " ${COLOR_ORANGE}$1${COLOR_CLEAR}" + echo " ${COLOR_ORANGE}${1//${COLOR_RESET}/${COLOR_ORANGE}}${COLOR_CLEAR}" } function ok () { @@ -930,14 +931,21 @@ function check_simulators () done if ! FAILED_SIMULATORS=$(mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" --only-check "${SIMS[@]}"); then - if ! test -z $PROVISION_SIMULATORS; then - mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}" - ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" + local action=warn + if test -z $OPTIONAL_SIMULATORS; then + action=fail + fi + if [[ "$FAILED_SIMULATORS" =~ "Unknown simulators:" ]]; then + $action "${FAILED_SIMULATORS}" + $action " If you just updated the Xcode version, it's likely Apple stopped shipping these simulators with the new version of Xcode." + $action " If that's the case, you can list the available simulators with ${COLOR_MAGENTA}make -C tools/siminstaller print-simulators${COLOR_RESET}," + $action " and then update the ${COLOR_MAGENTA}MIN__SIMULATOR_VERSION${COLOR_RESET} and ${COLOR_MAGENTA}EXTRA_SIMULATORS${COLOR_RESET} variables in Make.config to the earliest available simulators." else - if test -z $OPTIONAL_SIMULATORS; then - fail "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or need to be upgraded." + if ! test -z $PROVISION_SIMULATORS; then + mono --debug tools/siminstaller/bin/Debug/siminstaller.exe -q --xcode "$XCODE" "${SIMS[@]}" + ok "Extra simulators installed successfully: '${FAILED_SIMULATORS//$'\n'/', '}'" else - warn "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or should be upgraded." + $action "The simulators '${FAILED_SIMULATORS//$'\n'/', '}' are not installed or need to be upgraded." fi fi else diff --git a/tools/siminstaller/Makefile b/tools/siminstaller/Makefile index 1ec6afd5cb..84e4cea529 100644 --- a/tools/siminstaller/Makefile +++ b/tools/siminstaller/Makefile @@ -7,3 +7,6 @@ install-local:: all-local bin/Debug/siminstaller.exe: $(wildcard *.cs) $(wildcard *.csproj) Makefile $(Q_BUILD) $(SYSTEM_MSBUILD) /restore $(MSBUILD_VERBOSITY) $(wildcard *.csproj) + +print-simulators: bin/Debug/siminstaller.exe + mono $< --print-simulators --xcode=$(abspath $(XCODE_DEVELOPER_ROOT)/../..)