# target

> The BuildTarget to build.

## Definition

* **Type:** Property
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public BuildTarget target { readonly get; set; }
```

### Remarks

For best results, leave this property unset so that the build uses the target defined in the active [BuildProfile](/engine/6000.6/script-reference/unityeditor/build/profile/buildprofile.md). If you do set it, set it to match the active build target.

Building a target that doesn't match the active build target is unreliable. Changing the active build target requires recompiling Editor scripts for the new platform and a domain reload, which can't happen while a build script is running. As a result, build callbacks and platform-dependent code might compile for the wrong platform, and some platforms fail to build at all.

To select the target, set the active build profile first: use the Build Profiles window in the Editor, or the `-activeBuildProfile` or `-buildTarget` argument on the [command line](/engine/6000.6/manual/building-and-publishing/build-customize-build-pipeline/build-command-line.md). For more information, refer to [Create a custom build script](/engine/6000.6/manual/building-and-publishing/build-customize-build-pipeline/build-script-build.md).

Additional Resources: [\_activeBuildTarget](/engine/6000.6/script-reference/unityeditor/editoruserbuildsettings/activebuildtarget.md)
