It is not possible to build different iOS or Mac projects within a single solution that require different versions of Xcode. This is a regression introduced by fixing https://bugzilla.xamarin.com/show_bug.cgi?id=46257
Within a single msbuild process (e.g. msbuild Foo.sln):
1. Solution builds Foo.MacApp.csproj against already-configured environment (say, /Applications/Xcode_8.3.3.app), all is well
2. Now we need to build Foo.iOS.csproj, but against a different Xcoee (say, /Applications/Xcode_9.app). The target sets the environment variable [MD_APPLE_SDK_ROOT=/Applications/Xcode_9.app] to happen before the regular build starts
3. When the normal iOS build process starts, DetectSdkLocationsTaskBase.Execute will be called, which immediately calls Xamarin.MacDev.AppleSdkSettings.CheckChanged, which _should_ notice that the paths differ since the last run (from (1)), and reload everything (by calling Xamarin.MacDev.AppleSdkSettings.Init). However, this code has been completely commented out with no indication as to why.
As a result, whatever Xcode is used _first_within_the_process_ will be cached forever.
I have implemented a ReloadXcodeSettings task that we are now using to work around this for now: