# GetUnityTestTargetName()

> Returns the default test target name.

## Definition

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

```csharp
public static string GetUnityTestTargetName()
```

### Returns

| Type                                                           | Description                   |
| -------------------------------------------------------------- | ----------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The default test target name. |

### Remarks

Use the returned target name to retrieve the GUID of the target via [PBXProject.TargetGuidByName](/engine/6000.6/script-reference/unityeditor/ios/xcode/pbxproject/targetguidbyname.md).

**Note**: This function can only be used in Unity-generated projects.

### Examples

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

public class Sample_GetUnityTestTargetName  
{
    [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 Test target name
        string testTargetName = PBXProject.GetUnityTestTargetName();

        // Use the name to get Test target GUID
        string testTargetGuid = pbxProject.TargetGuidByName(testTargetName);

        // The test target GUID can be later used manipulating the pbxproj file
        pbxProject.AddFrameworkToProject(testTargetGuid, "Security.framework", false);
        pbxProject.SetBuildProperty(testTargetGuid, "ENABLE_BITCODE", "NO");

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