Visual Studio Universal App Database On Mac

  1. Visual Studio For Mac Tutorial
  2. Install Visual Studio Mac
-->

Visual Studio is on the mac and PC with visual studio 2017. The mac version is at the time of writing is in preview and has some xamarin and.net core stuff in it. Visual Studio for the Mac does not have everything the windows version does. Use the Visual Studio debugger to quickly find and fix bugs across languages. The Visual Studio for Mac debugger lets you step inside your code by setting Breakpoints, Step Over statements, Step Into and Out of functions, and inspect the current state of the code stack through powerful visualizations.

Watch this video and follow along to create your first mobile app with Xamarin.Forms.

Step-by-step instructions for Windows

Follow these steps along with the video above:

  1. Choose File > New > Project... or press the Create new project... button:

  2. Search for 'Xamarin' or choose Mobile from the Project type menu. Select the Mobile App (Xamarin.Forms) project type:

  3. Choose a project name – the example uses 'AwesomeApp':

  4. Click on the Blank project type and ensure Android and iOS are selected:

  5. Wait until the NuGet packages are restored (a 'Restore completed' message will appear in the status bar).

  6. New Visual Studio 2019 installations won't have an Android emulator configured. Click the dropdown arrow on the Debug button and choose Create Android Emulator to launch the emulator creation screen:

  7. In the emulator creation screen, use the default settings and click the Create button:

  8. Creating an emulator will return you to the Device Manager window. Click the Start button to launch the new emulator:

  9. Visual Studio 2019 should now show the name of the new emulator on the Debug button:

  10. Click the Debug button to build and deploy the application to the Android emulator:

Install visual studio mac

Customize the application

The application can be customized to add interactive functionality. Perform the following steps to add user interaction to the application:

  1. Edit MainPage.xaml, adding this XAML before the end of the </StackLayout>:

  2. Edit MainPage.xaml.cs, adding this code to the end of the class:

  3. Debug the app on Android:

Note

The sample application includes the additional interactive functionality that is not covered in the video.

Build an iOS app in Visual Studio 2019

It's possible to build and debug the iOS app from Visual Studio with a networked Mac computer. Refer to the setup instructions for more information.

This video covers the process of building and testing an iOS app using Visual Studio 2019 on Windows:

Step-by-step instructions for Windows

Visual Studio For Mac Tutorial

Follow these steps along with the video above:

  1. Choose File > New > Project... or press the Create new project... button, then select Visual C# > Cross-Platform > Mobile App (Xamarin.Forms):

  2. Ensure Android and iOS are selected, with .NET Standard code sharing:

  3. Wait until the NuGet packages are restored (a 'Restore completed' message will appear in the status bar).

  4. Launch Android emulator by pressing the debug button (or the Debug > Start Debugging menu item).

  5. Edit MainPage.xaml, adding this XAML before the end of the </StackLayout>:

  6. Edit MainPage.xaml.cs, adding this code to the end of the class:

  7. Debug the app on Android:

    Tip

    It is possible to build and debug the iOS app from Visual Studio with anetworked Mac computer. Refer to the setup instructionsfor more information.

Step-by-step instructions for Mac

Follow these steps along with the video above:

  1. Choose File > New Solution... or press the New Project... button, then select Multiplatform > App > Blank Forms App:

  2. Ensure Android and iOS are selected, with .NET Standard code sharing:

  3. Restore NuGet packages, by right-clicking on the solution:

  4. Launch Android emulator by pressing the debug button (or Run > Start Debugging).

  5. Edit MainPage.xaml, adding this XAML before the end of the </StackLayout>:

  6. Edit MainPage.xaml.cs, adding this code to the end of the class:

  7. Debug the app on Android:

  8. Right-click to set iOS to the Startup Project:

  9. Debug the app on iOS:

You can download the completed code from the samples gallery or view it on GitHub.

Next Steps

Install Visual Studio Mac

  • Single Page Quickstart – Build a more functional app.
  • Xamarin.Forms Samples – Download and run code examples and sample apps.
  • Creating Mobile Apps ebook – In-depth chapters that teach Xamarin.Forms development, available as a PDF and including hundreds of additional samples.