# How to install specific version of Mono on MacOS / Visual Studio for Mac / Xamarin stack

**URL:** <https://discuss.bitrise.io/t/how-to-install-specific-version-of-mono-on-macos-visual-studio-for-mac-xamarin-stack/3048>\
**Category:** How To\
**Tags:** xamarin, mono\
**Created:** [October 18, 2017, 8:51am UTC](https://discuss.bitrise.io/t/how-to-install-specific-version-of-mono-on-macos-visual-studio-for-mac-xamarin-stack/3048 "2017-10-18T08:51:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [October 18, 2017, 8:51am UTC](https://discuss.bitrise.io/t/how-to-install-specific-version-of-mono-on-macos-visual-studio-for-mac-xamarin-stack/3048/1 "2017-10-18T08:51:30Z")

</div>

If you’d need a specific version of mono other than the version which ships with Visual Studio for Mac, you can install any available mono version with a simple Script.

All you’ll need is the **macos** (universal) **pkg** download URL of the mono version you want to install, which you can get from: [https://download.mono-project.com/archive/](https://download.mono-project.com/archive/)

Simply add a **Script** step to the relevant workflow(s) as the very first step in the build (the script doesn’t have any dependencies so it’s safe to run even before Git Clone etc.):

```auto
#!/bin/bash
set -ex

# Get the macos universal pkg installer download url
# for the version you want to install from: https://download.mono-project.com/archive/
# and set it here as the value of this variable:
MONO_MACOS_PKG_DOWNLOAD_URL='https://download.mono-project.com/archive/5.2.0/macos-10-universal/MonoFramework-MDK-5.2.0.224.macos10.xamarin.universal.pkg'

# create a temp dir and cd into it
mkdir -p /tmp/mono-install
cd /tmp/mono-install

# debug: mono version before the install
mono --version

# download mono mac installer (pkg)
wget -q -O ./mono-installer.pkg "$MONO_MACOS_PKG_DOWNLOAD_URL"

# install it
sudo installer -pkg ./mono-installer.pkg -target /

# debug: mono version after install, just to confirm it did overwrite the original version
mono --version

# just for fun print this symlink too, which should point to the version we just installed
ls -alh /Library/Frameworks/Mono.framework/Versions/Current

```

That’s all! When this script finishes the mono version which you specified should be the used by the tools which use Mono (including Xamarin / Visual Studio for Mac).

Happy Building! 🙂
