安裝 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.13 或以上版本的 Mac。A Mac with macOS High Sierra 10.13 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 識別碼,可以在 https://appleid.apple.com 建立一個新識別碼。If you don't have an Apple ID already you can create a new one at https://appleid.apple.com. 安裝及登入 Xcode 時需要有 Apple 識別碼。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. 您可能會看到要從網際網路下載應用程式的相關警告。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:

    螢幕擷取畫面: Visual Studio Mac 安裝程式中的 [您要安裝什麼?] 畫面,其中顯示可供安裝的元件清單。Screenshot of the "What would you like to install?" screen in the Visual Studio Mac Installer, showing a list of components available for installation.

    如果您不想要安裝所有平台,請使用以下指南以協助您決定要安裝的平台: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 選取 AndroidiOS 平臺Select Android and iOS platforms 您將需要安裝 XcodeYou will need to install Xcode
    僅限 iOSiOS only 選取 iOS 平臺Select iOS platform 您將需要安裝 XcodeYou will need to install Xcode
    僅 AndroidAndroid only 選取 Android 平臺Select Android platform 請注意,您也應該選取相關的相依性Note that you should also select the relevant dependencies
    僅限 MacMac only 選取 macOS (Cocoa) platformSelect macOS (Cocoa) platform 您將需要安裝 XcodeYou 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.
  7. 選取完成之後,請按 [安裝] 按鈕。After you have made your selections, press the Install button.

  8. 安裝程式會顯示下載和安裝 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.:

    Visual Studio Mac 安裝程式的螢幕擷取畫面,其中顯示適用于 Mac 的 .NET 開發人員工具組的安裝進度畫面。Screenshot from the Visual Studio Mac Installer showing an installation progress screen for The .NET developer toolkit for Mac.

  9. 安裝之後,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

如果您在公司環境安裝時發生網路問題,請檢閱在防火牆或 Proxy 後方安裝指示。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.

注意

如果您在原始安裝期間選擇不安裝平台或工具 (在步驟 #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 Mac 安裝在防火牆或 Proxy 伺服器後方Install 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