Cách cài Visual Studio cho Macbook

Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Install Visual Studio for Mac

  • Article
  • 07/25/2022
  • 4 minutes to read

In this article

Applies to:

Visual Studio for Mac
Visual Studio

To start developing native, cross-platform .NET apps on macOS, install Visual Studio for Mac following the steps below.

Prerequisites

  • A Mac with macOS High Sierra 10.13 or above.

  • See Visual Studio 2022 for Mac System Requirements for supported operating systems, hardware, supported languages, and additional requirements and guidance.

To build Xamarin apps for iOS or macOS, you'll also need:

  • A Mac that is compatible with the latest version of Xcode. See Apple's minimum requirements documentation
  • The latest version of Xcode. It may be possible to use an older version of Xcode if your Mac isn't compatible with the latest version.
  • An Apple ID. If you don't have an Apple ID already, you can create a new one at //appleid.apple.com. It's necessary to have an Apple ID for installing and signing into Xcode.

Installation instructions

  1. Download the installer from the Visual Studio for Mac download page.

  2. Once the download is complete, select the VisualStudioforMacInstaller.dmg to mount the installer, then run it by double-clicking the arrow logo:

  3. You may be presented with a warning about the application being downloaded from the Internet. Select Open.

  4. Wait while the installer checks your system:

  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:

  6. The list of available workloads is displayed. Select the components you wish to use:

    If you don't wish to install all platforms, use the guide below to help you decide which platforms to install:

    Type of AppTargetSelectionNotes
    Apps Using Xamarin Xamarin.Forms Select Android and iOS platforms You'll need to install Xcode
    iOS only Select iOS platform You'll need to install Xcode
    Android only Select Android platform You should also select the relevant dependencies
    Mac only Select macOS [Cocoa] platform You'll need to install Xcode
    .NET Core applications Select .NET Core platform.
    ASP.NET Core Web Applications Select .NET Core platform.
    Azure Functions Select .NET Core platform.
    Cross-platform Unity Game Development No more platforms need to be installed beyond Visual Studio for Mac. For more information on installing the Unity extension, see the Unity setup guide.
  7. After you've made your selections, press the Install button.

  8. The installer will display progress as it downloads and installs Visual Studio for Mac and the selected workloads. You'll be prompted to enter your password to grant the privileges necessary for installation.

  9. Once installed, Visual Studio for Mac prompts you to personalize your installation by signing in and selecting the key bindings that you'd like to use:

  1. Download the installer from the Visual Studio for Mac download page.

  2. Once the download is complete, click the VisualStudioForMacInstaller_.dmg to mount the installer, then run it by double-clicking the arrow logo:

  3. You may be presented with a warning about the application being downloaded from the Internet. Select Open.

  4. An alert will appear asking you to acknowledge the privacy and license terms. Follow the links to read them, then select Continue if you agree:

  5. The list of available workloads is displayed. Select the components you wish to use:

    If you do not wish to install all platforms, use the guide below to help you decide which platforms to install:

    Type of AppTargetSelectionNotes
    Apps Using Xamarin Xamarin.Forms Select Android and iOS platforms You will need to install Xcode
    iOS only Select iOS platform You will need to install Xcode
    Android only Select Android platform Note that you should also select the relevant dependencies
    Mac only Select macOS [Cocoa] platform You will need to install Xcode
    .NET Core applications Select .NET Core platform.
    ASP.NET Core Web Applications Select .NET Core platform.
    Azure Functions Select .NET Core platform.
    Cross-platform Unity Game Development No additional platforms need to be installed beyond Visual Studio for Mac. Refer to the Unity setup guide for more information on installing the Unity extension.
  6. After you've made your selections, select the Install button.

  7. The installer will display progress as it downloads and installs Visual Studio for Mac and the selected workloads. You'll be prompted to enter your password to grant the privileges necessary for installation.

  8. 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:

  9. Visual Studio for Mac will launch, and you can open a project or create a new one.

If you have network trouble while installing in a corporate environment, review the installing behind a firewall or proxy instructions.

Note

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.

Install Visual Studio for Mac behind a firewall or proxy server

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:

  • Visual Studio endpoints

Next steps

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.

iOS

  • Hello, iOS
  • Device Provisioning [To run your application on device]

Android

  • Hello, Android
  • Using the Xamarin Android SDK Manager
  • Android SDK Emulator
  • Set Up Device for Development

Xamarin.Forms

Build native cross-platform applications with Xamarin.Forms:

  • Xamarin.Forms Quickstarts

.NET Core apps, ASP.NET Core web apps, Unity game development

For other Workloads, refer to the Workloads page.

Feedback

Submit and view feedback for

Chủ Đề