Skip to content

Instantly share code, notes, and snippets.

@dimonovdd
Last active February 1, 2024 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimonovdd/226a48a00f9bbe89578615225cd7bd34 to your computer and use it in GitHub Desktop.
Save dimonovdd/226a48a00f9bbe89578615225cd7bd34 to your computer and use it in GitHub Desktop.
MacOS install MSBuild
# Rosseta
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
# Xcode Command Line Tools (Need Xcode)
xcode-select --install
sudo xcode-select -s /Applications/Xcode.app
# Microsoft OpenJDK 11
# https://learn.microsoft.com/en-us/java/openjdk/download
mkdir -p ~/temp
curl -o ~/temp/jdk.pkg -L https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macOS-aarch64.pkg
sudo installer -pkg ~/temp/jdk.pkg -target /
# Add Android SDK Link (Need Android SDK and NDK)
mkdir -p ~/Library/Developer/Xamarin/
ln -s ~/Library/Android/sdk ~/Library/Developer/Xamarin/android-sdk-macosx
# MONO
# https://www.mono-project.com/download/stable/
curl -o ~/temp/mono.pkg https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.182.macos10.xamarin.universal.pkg
sudo installer -pkg ~/temp/mono.pkg -target /
echo 'export MSBUILD_FOR_RUNNER=/Library/Frameworks/Mono.framework/Versions/Current' >> ~/.bash_profile
echo 'export MSBUILD_FOR_RUNNER=/Library/Frameworks/Mono.framework/Versions/Current' >> ~/.bashrc
echo 'export MSBUILD_FOR_RUNNER=/Library/Frameworks/Mono.framework/Versions/Current' >> ~/.zprofile
echo 'export MSBUILD_FOR_RUNNER=/Library/Frameworks/Mono.framework/Versions/Current' >> ~/.zshenv
# Dotnet
# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
sudo mkdir -p /usr/local/share/dotnet
sudo chmod -R 777 /usr/local/share/dotnet
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 3.1.426 --architecture x64 --install-dir /usr/local/share/dotnet/x64
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 5.0.408 --architecture x64 --install-dir /usr/local/share/dotnet/x64
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS --architecture x64 --install-dir /usr/local/share/dotnet/x64
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS --install-dir /usr/local/share/dotnet
echo 'export DOTNET_ROOT=/usr/local/share/dotnet' >> ~/.bashrc
echo 'export DOTNET_ROOT_ARM64=/usr/local/share/dotnet' >> ~/.bashrc
echo 'export DOTNET_ROOT_X64=/usr/local/share/dotnet/x64' >> ~/.bashrc
echo 'export DOTNET_ROOT=/usr/local/share/dotnet' >> ~/.zshenv
echo 'export DOTNET_ROOT_ARM64=/usr/local/share/dotnet' >> ~/.zshenv
echo 'export DOTNET_ROOT_X64=/usr/local/share/dotnet/x64' >> ~/.zshenv
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc
source ~/.bashrc
sudo mkdir -p /usr/local/bin
sudo chmod -R 777 /usr/local/bin
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
dotnet dev-certs https --trust
# Xamarin.iOS
# https://github.com/xamarin/xamarin-macios/blob/main/DOWNLOADS.md
curl -o ~/temp/xamrin_ios.pkg https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/3960868aa9b1946a6c77668c3f3334ee/xamarin.ios-16.4.0.23.pkg
sudo installer -pkg ~/temp/xamrin_ios.pkg -target /
# Xamarin.Android
# https://github.com/xamarin/xamarin-android#current
curl -o ~/temp/xamrin_droid.pkg -L https://aka.ms/xamarin-android-commercial-d17-5-macos
sudo installer -pkg ~/temp/xamrin_droid.pkg -target /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment