安装 Visual Studio 2019 for MacInstall Visual Studio 2019 for Mac

要开始在 macOS 上开发本机跨平台 .NET 应用,请按照下列步骤安装 Visual Studio 2019 for Mac。To start developing native, cross-platform .NET apps on macOS, install Visual Studio 2019 for Mac following the steps below.

要求Requirements

  • 配备 macOS High Sierra 10.12 或更高版本的 Mac。A Mac with macOS High Sierra 10.12 or above.

要为 iOS 或 macOS 构建 Xamarin 应用,还需要:To build Xamarin apps for iOS or macOS, you'll also need:

  • Xcode 10.0 或更高版本。Xcode 10.0 or above. 通常建议使用稳定的最新版本。The latest stable version is usually recommended.
  • 一个 Apple ID。An Apple ID. 如果没有 Apple ID,请在 https://appleid.apple.com 新建一个。If you don't have an Apple ID already you can create a new one at https://appleid.apple.com. 需要 Apple ID 才可安装和登录 Xcode。It's necessary to have an Apple ID for installing and signing into Xcode.

安装说明Installation instructions

  1. Visual Studio for Mac 下载页面下载安装程序。Download the installer from the Visual Studio for Mac download page.

  2. 下载完成后,单击 VisualStudioforMacInstaller.dmg 以装载安装程序,然后双击箭头徽标运行它 :Once the download is complete, click the VisualStudioforMacInstaller.dmg to mount the installer, then run it by double-clicking the arrow logo:

    单击大箭头开始安装Click the large arrow to begin installation

  3. 可能会收到有关从 Internet 下载应用程序的警告。You may be presented with a warning about the application being downloaded from the Internet. 单击“打开” 。Click Open.

  4. 安装程序检查系统时,请耐心等待:Wait while the installer checks your system:

    安装程序会检查系统中是否有已安装的组件The installer checks your system for installed components

  5. 将出现一条警告,要求确认隐私和许可条款。An alert will appear asking you to acknowledge the privacy and license terms. 请点击链接仔细阅读,如果同意,则按“继续”: Follow the links to read them, then press Continue if you agree:

    请点击隐私和条款的链接,如果同意,请继续Follow the links to the privacy and terms, then continue if you agree

  6. 此时显示可用的工作负载列表。The list of available workloads is displayed. 选择你要使用的组件:Select the components you wish to use:

    选择要安装的可选工作负载功能Choose which optional workload features you would like to install

    如果不希望安装所有平台,请参阅以下指南,它们有助于确定要安装的平台:If you do not wish to install all platforms, use the guide below to help you decide which platforms to install:

应用类型Type of App 目标Target 选择Selection 说明Notes
使用 Xamarin 的应用Apps Using Xamarin Xamarin.FormsXamarin.Forms 选择“Android”和“iOS”平台 Select Android and iOS platforms 你需要安装 Xcode You will need to install Xcode
仅限 iOSiOS only 选择“iOS”平台 Select iOS platform 你需要安装 Xcode You will need to install Xcode
仅限 AndroidAndroid only 选择“Android”平台 Select Android platform 请注意,还应选择相关的依赖项Note that you should also select the relevant dependencies
仅限 MacMac only 选择“macOS (Cocoa)”平台 Select macOS (Cocoa) platform 你需要安装 Xcode You will need to install Xcode
.NET Core 应用程序.NET Core applications 选择“.NET Core”平台 。Select .NET Core platform.
ASP.NET Core Web 应用程序ASP.NET Core Web Applications 选择“.NET Core”平台 。Select .NET Core platform.
Azure FunctionsAzure Functions 选择“.NET Core”平台 。Select .NET Core platform.
跨平台 Unity 游戏开发Cross-platform Unity Game Development 除了 Visual Studio for Mac 之外,无需安装任何其他平台。No additional platforms need to be installed beyond Visual Studio for Mac. 若要详细了解如何安装 Unity 扩展,请参阅 Unity 安装指南Refer to the Unity setup guide for more information on installing the Unity extension.
  1. 完成选择后,按下“安装”按钮 。After you have made your selections, press the Install button.

  2. 安装程序将在下载并安装 Visual Studio for Mac 和所选工作负载时显示进度。The installer will display progress as it downloads and installs Visual Studio for Mac and the selected workloads. 系统将提示输入密码以授予安装所需的权限。You will be prompted to enter your password to grant the privileges necessary for installation.:

    选择要安装的可选工作负载功能Choose which optional workload features you would like to install

  3. 安装完成后,Visual Studio for Mac 会提示你通过登录并选择要使用的键绑定来个性化安装:Once installed, Visual Studio for Mac will prompt you to personalize your installation by signing in and selecting the key bindings that you'd like to use:

    登录到 IDESign in to the IDE

    选择要使用的键盘快捷方式Choose which keyboard shortcuts you would like to use

如果在企业环境中安装时遇到网络问题,请查看在有防火墙或代理的情况下进行安装的说明。If you have network trouble while installing in a corporate environment, review the installing behind a firewall or proxy instructions.

了解有关发行说明中的更改详细信息。Learn more about the changes in the release notes.

Note

如果在原始安装期间选择不安装平台或工具(方法为在第 #6 步中取消选择相关项),必须要在稍后添加组件时再次运行安装程序。If you chose not to install a platform or tool during the original installation (by unselecting it in step #6), you must run the installer again if you wish to add the components later.

在防火墙或代理服务器后安装 Visual Studio for MacInstall Visual Studio for Mac behind a firewall or proxy server

若要在防火墙后面安装 Visual Studio for Mac,必须将某些终结点设置为可供访问,以允许下载所需的工具和更新软件。To install Visual Studio for Mac behind a firewall, certain endpoints must be made accessible in order to allow downloads of the required tools and updates for your software.

配置网络以允许访问下列位置:Configure your network to allow access to the following locations:

后续步骤Next steps

安装 Visual Studio for Mac 后,可以开始编写应用代码。Installing Visual Studio for Mac allows you to start writing code for your apps. 下面的指南逐步介绍了如何完成后续步骤,即编写和部署项目。The following guides are provided to guide you through the next steps of writing and deploying your projects.

iOSiOS

  1. Hello,iOSHello, iOS
  2. 设备预配(以在设备上运行应用程序)。Device Provisioning(To run your application on device).

AndroidAndroid

  1. 使用 Xamarin Android SDK 管理器Using the Xamarin Android SDK Manager
  2. Android SDK 仿真器Android SDK Emulator
  3. 设置设备进行开发Set Up Device for Development

.NET Core 应用、ASP.NET Core Web 应用、Unity 游戏开发.NET Core apps, ASP.NET Core web apps, Unity game development

有关其他工作负载,请参阅工作负载页。For other Workloads, refer to the Workloads page.

请参阅See also