C++ In Visual Studio For Mac

Installation

  1. Download Visual Studio Code for macOS.
  2. Double-click on the downloaded archive to expand the contents.
  3. Drag Visual Studio Code.app to the Applications folder, making it available in the Launchpad.
  4. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock.

Visual Studio for Mac isn’t just for mobile, however. The web editing experience on Visual Studio for Mac comes directly from code ported from Visual Studio (on Windows).

Launching from the command line

You can also run VS Code from the terminal by typing 'code' after adding it to the path:

  • Launch VS Code.
  • Open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
  • Restart the terminal for the new $PATH value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.

Note: If you still have the old code alias in your .bash_profile (or equivalent) from an early VS Code version, remove it and replace it by executing the Shell Command: Install 'code' command in PATH command.

To manually add VS Code to your path, you can run the following commands:

Start a new terminal to pick up your .bash_profile changes.

Note: The leading slash is required to prevent $PATH from expanding during the concatenation. Remove the leading slash if you want to run the export command directly in a terminal.

Touch Bar support

Out of the box VS Code adds actions to navigate in editor history as well as the full Debug tool bar to control the debugger on your Touch Bar:

Mojave privacy protections

After upgrading to macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave and is not specific to VS Code. The same dialogs may be displayed when running other applications as well. The dialog is shown once for each type of personal data and it is fine to choose Don't Allow since VS Code does not need access to those folders. You can read a more detailed explanation in this blog post.

Updates

VS Code ships monthly releases and supports auto-update when a new release is available. If you're prompted by VS Code, accept the newest update and it will get installed (you won't need to do anything else to get the latest bits).

Note: You can disable auto-update if you prefer to update VS Code on your own schedule.

Preferences menu

You can configure VS Code through settings, color themes, and custom keybindings and you will often see mention of the File > Preferences menu group. On a macOS, the Preferences menu group is under Code, not File.

Next steps

Once you have installed VS Code, these topics will help you learn more about VS Code:

  • Additional Components - Learn how to install Git, Node.js, TypeScript, and tools like Yeoman.
  • User Interface - A quick orientation around VS Code.
  • User/Workspace Settings - Learn how to configure VS Code to your preferences settings.

Common questions

Why do I see 'Visual Studio Code would like access to your calendar.'

If you are running macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave discussed above. It is fine to choose Don't Allow since VS Code does not need access to those folders.

FAQ

  • Connect to Turing
  • Enhance Windows Performance

System Requirements

  • To install Visual Studio on your Mac you need, minimumally:
    • an Intel Mac
    • 1 GB of Memory
    • 25 GB of free hard drive space
  • You can check the first two by clicking on the Apple icon on the top left and opening up 'About this Mac'.

Downloads

  • Download VirtualBox for yor Mac here
  • This downloads the file VirtualBox-3.2.8-64453-OSX.dmg.
  • Open this file and follow the installation instructions.

Create a Virtual Machine

  • Start VirtualBox
  • Create a new virtual machine by pressing the blue star labeled New




Mac
  • Press continue on the dialog box.
    • Name your machine: Win7-CS150
    • Operating System: Microsoft Windows
    • Version: Windows 7
  • Press continue on the dialog box.
  • In the Memory dialog, give your machine 1024 MB of RAM. You can type in the box on the right.
  • Press continue on the dialog box.
  • In the Virtual Hard Disk screen accept the defaults (Boot Hard Disk, Create new hard disk) and press continue.
  • In the Welcome to the Create New Virtual Disk Wizard press continue.
  • Select a Fixed-Size storage in the Hard Disk Storage Type and press continue.
  • Specify a 25 GB hard drive in the Virtual Disk Location andSize dialog. You can type in the box on the right. Press continue.
  • In the Summary dialog, press Done. Wait while it processes.This may take up to 30 minutes, depending on the speed of your machine.
  • Once this finishes, press Done.

Install Windows

  • You should now see Win7-CS150 listed on the left side on the
    VirtualBox Window. Select that virtual machine.
  • Put the Windows 7 Disk in the CD/DVD Drive

  • Click Storage on the right panel.
  • Select the Empty CD/DVD
  • In the right panel, choose Host Drive in the CD/DVD Device drop down box. and press OK.
  • With Win7-CS150 highlighed, press the green Start arrow at the top of
    the window.
  • This should start the Windows 7 Installer. TheInstaller will ask you various questions and take up to 2 hours toinstall Windows.
  • Once Windows completes the installation eject the Windows install disk.
  • While Windows is not running, Click Storage, the CD/DVD Icon, and set the CD/DVD Device to Empty.
  • The DVD may show up on the Mac desktop. If it does, drag it to the Trash to eject the DVD.

Install Visual Studio

  • Put in the Visual Studio Disk
  • While Windows is not running, Click Storage, the CD/DVD Icon, and set the CD/DVD Device to Host Drive.
  • Start Windows again.
  • The Visual Studio DVD should show up in Windows. If not,inside of Windows open My Computer, and click on the CD/DVDDrive. This should start the Visual Studio installer.
  • The install may take up to an hour. Once the installfinishes, eject the DVD as described above and Visual Studio shouldwork.
  • Bring both disks back to the instructor and you'll be given a Windows Key to activate Windows.

Activate Windows

  • Start Windows.
  • Open My Computer
    • Start Menu | Computer
  • Choose System Properties from the menu bar.
  • Click on the Active Windows Now link towards the bottom of the dialog box.
  • Provide the license key given to you by the CS Department. You need to be connected to the network for this to work.

Visual Studio Community Mac


Connect to Turing

  • Open My Computer
    • Start Menu | Computer
  • Choose Map network drive from the menu bar.
  • Choose a drive letter (any letter)
  • Folder: turing.cs.pacificu.eduStudents
  • Check Connect using different credentials
  • Press Finish
  • Supply your PUNetID for your user name and your Turing password.
  • The Turing drive should show up on the bottom of the computer dialog under Network Locations.

Update Windows

  • Open My Computer
    • Start Menu | Computer
  • Choose System Properties from the menu bar.
  • Select Windows Update in the lower left corner
  • Select any important or optional updates to install
  • Install Updates
Visual

Enhance Windows Performance

Visual Studio For Mac Tutorial

  • Open My Computer
    • Start Menu | Computer
  • Choose System Properties from the menu bar.
  • Select Performance Information and Tools in the lower left corner
  • Select Adjust visual effects on the left menu
  • Choose Adjust for best performance
  • Apply
  • Ok

Mac C++ Debug