Search Unity

GetBuildPropertyForConfig doesn't return anything

Discussion in 'iOS and tvOS' started by greay, Jul 25, 2018.

  1. greay

    greay

    Joined:
    Mar 23, 2011
    Posts:
    88
    I'm trying to set up a post-process build script to first check for an existing entitlements file before creating a new one. But even when I know there is one, it returns null.

    Code (CSharp):
    1. project.AddBuildProperty(targetGUID, "CODE_SIGN_ENTITLEMENTS", relativeDestination);
    2. string existingEntitlements = project.GetBuildPropertyForConfig(targetGUID, "CODE_SIGN_ENTITLEMENTS");
    3. Debug.LogFormat("=> {0}", existingEntitlements);
     
  2. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    GetBuildPropertyForConfig takes a config GUID as a parameter, but you're passing in a target GUID. You could use GetBuildPropertyForAnyConfig, otherwise you'll have to get the build config GUID first with BuildConfigByName.

    Sam