XCode license must be accepted in order to be connected and working against the Mac

So, I recently refreshed my Mac - I use it for Xamarin development and while I am travelling or to show off :D

I use it in conjunction of my awesome Windows Desktop Build with VS2017. So I follow the drill, install Mac - update all things - setup iTunes etc.

This time I started with Brew first to install NodeJS - even before I installed XCode or Xamarin - Brew suggested to install XCode command line tools so I installed it (almost there, hang on).

Then I installed XCode (v8.3.2 in my case - yours might be different) and then all things Xamarin. This worked pretty well on MAC somehow.

But then I tried to connect my VS + Xamarin setup with Xamarin Mac Agent and I keep getting this error:

Xcode license must be accepted in order to be connected and working against the Mac

VS connection to Xamarin MAC agent failed

I did checked for the version of Xamarin across MAC and VS and they where same - this usually is the problem for most of the folks.

Also pretty sure that XCode did not asked me to accept any similar license when I installed + first run it.

Here is how i resolved it:

Step: In XCode go to XCode > Preference... > Locations

Make sure you have correct version of XCode Command Line Tools selected

Here is a screenshot of how mine looks:

In my case I have Xcode 8.3.2 (8E20002) selected.

Step: Open terminal on Mac and type the following command:

sudo xcodebuild -license

Follow the on terminal instruction to complete the license acceptance - basically lots of space pressing and typing 'agree' and done!

Once I followed this steps my VS connected successfully with Xamarin Mac Agent, hope this helps other, cheers.

Happy Coding!