Choose version of Xcode to use during the build. (#2157)

This commit is contained in:
David Britch 2024-03-19 15:40:26 +00:00 коммит произвёл GitHub
Родитель d88e9e2fd5
Коммит aeb09e355a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -27,6 +27,8 @@ In this tutorial, you'll learn how to create and run a .NET Multi-platform App U
<!-- markdownlint-enable MD029 -->
[!INCLUDE [choose Xcode version](~/macios/includes/choose-xcode-version.md)]
## Launch the app on a specific simulator
A .NET MAUI iOS app can be launched on a specific iOS simulator from a Mac by providing its unique device id (UDID):

Просмотреть файл

@ -32,3 +32,5 @@ In this tutorial, you'll learn how to create and run a .NET Multi-platform App U
:::image type="content" source="media/cli/maccatalyst-running-app.png" alt-text=".NET MAUI app running on Mac.":::
<!-- markdownlint-enable MD029 -->
[!INCLUDE [choose Xcode version](~/macios/includes/choose-xcode-version.md)]

Просмотреть файл

@ -0,0 +1,22 @@
---
ms.topic: include
ms.date: 03/19/2024
---
## Build with a specific version of Xcode
If you have multiple versions of Xcode installed on your Mac, it's possible to specify which Xcode version should be used when building your app. There are a number of approaches that can be used to accomplish this, but the recommended approach is to set the `MD_APPLE_SDK_ROOT` environment variable to the path of the Xcode version.
> [!WARNING]
> Using `xcode-select -s` to set the version of Xcode to use isn't recommended.
To set the `MD_APPLE_SDK_ROOT` environment variable for the duration of the current terminal session:
1. Open the **Terminal** application.
1. Type the following command, substituting in your version of Xcode, and press Enter:
```zsh
export MD_APPLE_SDK_ROOT=/Applications/Xcode_14.1.0.app
```
If you want to set this environment variable permanently, you can add the `export` command to your shell profile, such as *.zprofile*.