Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How can I set Xcode build setting's "Supported Platforms" to "iOS"

Discussion in 'iOS and tvOS' started by 56-bit, Dec 11, 2016.

  1. 56-bit

    56-bit

    Joined:
    Dec 11, 2016
    Posts:
    13
    I tried the code below in my PostProcessBuild function. Looking at it in XCode, it seems correct at first, but when right clicking on the attribute, it shows that it sets it to an extra string value "iOS", but didn't actually choose iOS. So somehow I'm not setting the right value in the SetBuildProperty.

    Any ideas? I'm surprised that no one has run into this yet....

    PBXProjectpbxProject=newPBXProject();
    pbxProject.ReadFromFile(projectPath);
    string target = pbxProject.TargetGuidByName("Unity-iPhone");
    pbxProject.SetBuildProperty(target,"SUPPORTED_PLATFORMS","iOS");
     
  2. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @56-bit,
    If you open up the project.pbxproj file, you can see what the value is of this property. When in Xcode and my Supported Platforms property is set to iOS, the project.pbxproj has:

    Code (CSharp):
    1. SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
    Does this answer your question?
    Cheers,
    Chris
     
  3. 56-bit

    56-bit

    Joined:
    Dec 11, 2016
    Posts:
    13
    thanks for your reply
    I looked in there, and it doesn't completely make sense

    SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
    SUPPORTED_PLATFORMS.DEBUG = iOS;

    so the "iphone simulator iphones" doesnt make sense because that's not what it's set to. And the second line, iOS is not in "", meaning it's not a string. I only know how to assign it as a string. how can I assign that iOS value?
     
  4. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    On Xcode "iOS" is only a placeholder, the actual value is hidden. To see it, you need to click on the value as if you wanted to change it, and then select "Other".
     
    gaolei_nls likes this.