Forum Visual Studio

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How to set iOS SDK path for Visual Studio for Mac without IDE

We use Jenkins for our CI/CD pipeline and there are multiple Xcode versions installed on our Mac build servers

Xamarin builds using MSBuild launches a particular xcode version using the path settings for the iOS SDK defined via the Visual Studio for Mac IDE.
On my local machine I can login as Jenkins user, start the IDE and change the settings, but on our production CI/CD pipeline I'm not allowed to login using a graphical interface (command tool only)

So I need to figure out how I can set the Xcode sdk path that MSBuild uses.

Is there

  • a command line option that I can use with MSBuild to indicate which XCode SDK it needs to use?
  • or what configuration file is change when changing the Xcode SDK path using Visual Studio for Mac IDE?
Tagged:

Best Answer

  • FrederickDhontFrederickDhont BEMember ✭✭
    Accepted Answer

    So, you can change the target Xcode SDK by changing the following file

    • /Users/…./Library/Preferences/Xamarin/Settings.plist

    and change the content for the key [AppleSdkRoot]

Answers

  • FrederickDhontFrederickDhont BEMember ✭✭
    Accepted Answer

    So, you can change the target Xcode SDK by changing the following file

    • /Users/…./Library/Preferences/Xamarin/Settings.plist

    and change the content for the key [AppleSdkRoot]

  • mwesolowskimwesolowski PLMember ✭✭

    What about parallel build when two or more builds will work on jobs with different Xcode requirements?

    This should be definitely moved to msbuild param.

  • Sk8rMarcSk8rMarc Member
    edited October 2019
    Xcode is easy. Go ahead and install multiple version of Xcode, for example /Applications/Xcode_10.2.1.app and /Applications/Xcode_11.1.app

    To use a specific version of Xcode, in your build script, before invoking msbuild, set DEVELOPER_DIR to the associated app bundle, for example export DEVELOPER_DIR=/Applications/Xcode_10.2.1.app

    My question is about having multiple versions of Mono MDK, .NET Core Runtime/SDK, and Xamarin.iOS and Xamarin.Android. What environment variables to set or msbuild properties to set to choose these? Of course for Android builds, we can set AndroidSdkDirectory and AndroidNdkDirectory msbuild properties. And I guess JAVA_HOME environment variable or I wonder what msbuild property to set for that?
  • colincornabycolincornaby USMember

    @Sk8rMarc said:
    Xcode is easy. Go ahead and install multiple version of Xcode, for example /Applications/Xcode_10.2.1.app and /Applications/Xcode_11.1.app

    To use a specific version of Xcode, in your build script, before invoking msbuild, set DEVELOPER_DIR to the associated app bundle, for example export DEVELOPER_DIR=/Applications/Xcode_10.2.1.app

    I wish this worked but it does not seem to. We have a lot of builds setting DEVELOPER_DIR and msbuild does not seem to respect it. I'm going to investigate the plist file, maybe something in the plist file could be done to get it to respect DEVELOPER_DIR.

Sign In or Register to comment.