4 Steps to Set Up a Xamarin Development Environment on a Mac

By: Admin

setting up Mac with Xamarin

Setting up Xamarin in a Mac environment can be confusing. Here are the steps I took to configure my Mac for Xamarin development.

Before starting the setup, double check that you have the latest version of Xcode and Visual Studio for Mac. If you don’t have “Xcode,” please download it from the App Store.

Step 1: Open XCode and go to Preferences.

open preferences

Step 2: Select Accounts. Click + to add a new account.

Account creation

Step 3: Choose Apple ID from the list of accounts.

Step 4: Enter your Apple developer account credentials.

Missing Visual Studio for Mac? Follow the installation steps below.

Step 1: Visit https://www.visualstudio.com/.  Select Download for Mac and pick the version that you want to download.

Mac version

Step 2: Double tap on the installer program, Install Visual Studio for Mac.

VS for Mac

Step 3: Select Open.

Open installation

The installation process will be initiated.

Installation Initiated

Step 4: Check all platforms on the list that you need. Make sure the box for Xamarin Workbooks & Inspector is checked.

Xamarin Workbooks and Inspector

Step 5: Select Install and Update to initiate the installation process.

Update

Step 6: During the installation, you will need to enter your Mac Account credentials.

Mac account Credentials

Step 7: After a successful installation, click Done.

process completed

If you’re downloading Visual Studio for Mac for the first time, then you need to install Fastlane for Mac. If you already have Fastlane installed, check that you have the latest version.

Make sure that Xcode command line tools are installed. To install the tools, use the command xcode-select –install in Terminal. If they are already installed, the following error will be displayed:

“Error: command line tools are already installed, use “Software Update” to install updates”

Download the Fastlane tools from https://download.fastlane.tools.

Note: It is possible to install Fastlane tools from Homebrew using brew cask install fastlane or via Rubygems (2.0 or above) using sudo gem install fastlane –NV. Using the installer will ensure that the correct dependencies are available.

Install Fastlane by unzipping the file and double-clicking on the install file. If you get an error advising that the file “can’t be opened because it is from an unidentified developer,” press OK and do the following:

CTRL+Click on the install file. This will display the dialog below:

fastlane

• Press “Open” to start installing fastlane tools.

The terminal will prompt you with the dialog illustrated below. Press “y”:Open fastlane tools

Terminal

Run “which fastlane” before using fastlane for the first time. The path should look like the following:
/Users/[user]/.fastlane/bin
If the path matches the above, you’re ready to get started. If not, do the following: On macOS open “.bash_profile”, which is a hidden plaintext file in the home directory, with the following command:
open ~/.bash_profile
If you don’t have .bash_profile, you can create a new one:
• Start up Terminal.
• Type “cd ~/” to go to your home folder.
• Type “touch .bash_profile” to create your new file.

Add the following PATH environment variable, and save it:
export PATH=”$HOME/.fastlane/bin:$PATH”

Run “which fastlane” again, to confirm the path looks like /Users/[user]/.fastlane/bin

Open Visual Studio for Mac, then go to Preferences.

Mac Visual Studio

Open Apple Developer Accounts under Publishing and select +.

Apple Developer Accounts

Sign into your Apple developer account.

Signing In

Open the Provisioning file with Xcode.

Xcode

Now we need to add certificate to the Keychain Access.
Open Keychain Access and select Login.

Keychain access

Go to File -> Import Items.

Import Items

Choose the certificate file and select Open. 

Certificate choosing

With the setup completed, now you can start the Xamarin application development on your Mac.

What are you looking for?

Join our newsletter list of over 5,000 innovators and receive an email update every other month

Copyright © 2018 alligatortek. All rights reserved.