# SetBuildPropertyForConfig

> Sets a build property to the given value in the specified build configuration(s).

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.iOS.Xcode](/engine/6000.5/script-reference/unityeditor/ios/xcode.md)
* **Assembly:** UnityEditor.iOS.Extensions.Xcode

## SetBuildPropertyForConfig(string, string, string)

Sets a build property to the given value in the specified build configuration(s).

```csharp
public void SetBuildPropertyForConfig(string configGuid, string name, string value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The GUID of the build configuration as returned by [PBXProject.BuildConfigByName](/engine/6000.5/script-reference/unityeditor/ios/xcode/pbxproject/buildconfigbyname.md).**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the build property.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The value of the build property.

### Remarks

Duplicate build properties are ignored. Values for names `LIBRARY_SEARCH_PATHS` and `FRAMEWORK_SEARCH_PATHS` are quoted if they contain spaces.

### Examples

```csharp
using UnityEditor;
using System.IO;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;

public class Sample_SetBuildPropertyForConfig  
{
    [PostProcessBuild]
    public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
    {

        // Stop processing if build target is not iOS
        if (buildTarget != BuildTarget.iOS)
            return;

        // Initialize PBXProject
        string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
        PBXProject pbxProject = new PBXProject();
        pbxProject.ReadFromFile(projectPath);

        // Get the GUID you want to set a build property on
        string unityFrameworkTargetGuid = pbxProject.GetUnityFrameworkTargetGuid();

        // Get the GUID of the "Debug" config so you can use it to change config-specific settings
        string configGuid = pbxProject.BuildConfigByName(unityFrameworkTargetGuid, "Debug");

        // Set "ENABLE_BITCODE" to "NO" for "Debug" config 
        pbxProject.SetBuildPropertyForConfig(configGuid, "ENABLE_BITCODE", "NO");

        // Apply changes to the pbxproj file
        pbxProject.WriteToFile(projectPath);
    }
}
```

## SetBuildPropertyForConfig(IEnumerable\<string>, string, string)

Sets a build property to the given value in the specified build configuration(s).

```csharp
public void SetBuildPropertyForConfig(IEnumerable<string> configGuids, string name, string value)
```

### Parameters

**** (\[IEnumerable\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)): The GUIDs of the build configurations as returned by [PBXProject.BuildConfigByName](/engine/6000.5/script-reference/unityeditor/ios/xcode/pbxproject/buildconfigbyname.md).**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the build property.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The value of the build property.

### Remarks

Duplicate build properties are ignored. Values for names `LIBRARY_SEARCH_PATHS` and `FRAMEWORK_SEARCH_PATHS` are quoted if they contain spaces.

### Examples

```csharp
using UnityEditor;
using System.IO;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;

public class Sample_SetBuildPropertyForConfig  
{
    [PostProcessBuild]
    public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
    {

        // Stop processing if build target is not iOS
        if (buildTarget != BuildTarget.iOS)
            return;

        // Initialize PBXProject
        string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
        PBXProject pbxProject = new PBXProject();
        pbxProject.ReadFromFile(projectPath);

        // Get the GUID you want to set a build property on
        string unityFrameworkTargetGuid = pbxProject.GetUnityFrameworkTargetGuid();

        // Get the GUID of the "Debug" config so you can use it to change config-specific settings
        string configGuid = pbxProject.BuildConfigByName(unityFrameworkTargetGuid, "Debug");

        // Set "ENABLE_BITCODE" to "NO" for "Debug" config 
        pbxProject.SetBuildPropertyForConfig(configGuid, "ENABLE_BITCODE", "NO");

        // Apply changes to the pbxproj file
        pbxProject.WriteToFile(projectPath);
    }
}
```
