# Build and deploy

### Build a simulator to be uploaded to the cloud

A **simulator build** is a built Unity Player for the Linux 64-bit platform that you can upload to coherence straight from Unity Editor.

{% hint style="info" %}
Make sure you have run through [Build and run](https://docs.coherence.io/0.8/get-started/build-and-run) and [Create an account](https://docs.coherence.io/0.8/get-started/create-an-account).
{% endhint %}

On Unity's menu bar, navigate to `coherence -> Simulator -> Build Wizard`.

![](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-96bd2ebee150d96eea9d598edce5d3dbfee09627%2Fmenu%20item.png?alt=media)

From within the **Build Wizard** you can build and upload simulators.

The **Info** tab provides information and requirements to build simulators properly.

![](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-890c7cd7c9a8bf729553a7e07ee19840a4490f66%2Fsimulator%20window.png?alt=media)

The **Build** tab creates valid simulator builds from **Build Configuration Assets.**

![](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-fa737177208f926e7d970d446ef82f7e78ea510f%2Fsimulator%20build%20tab.png?alt=media)

{% hint style="warning" %}
There's a known issue in the Platforms package provided by Unity where builds will fail when the project is not in the target build platform. To prevent this from happening, please **switch your active platform to match the one used in your build configuration** before building.
{% endhint %}

#### Creating a Build Configuration Asset

You can create them via `Assets -> Create -> coherence -> Simulator Build Configuration`.

A newly created build configuration looks like this:

![](https://github.com/coherence/docs/blob/sdk-0.8/.gitbook/assets/build%20config%20asset.png)

There are several settings you might want to change.

* Specify the scenes you want to get in the build via the **Scene List** component.
* Specify a *Company Name* and a *Version* from the **General Settings** component (optional).
* Additionally, you can add our OptimizeForSize component (find it using **Add Component**). Specify which optimizations you want to use to reduce the final build size from the **Optimize For Size** component (optional).

#### Reducing simulator build size (experimental ⚠️)

{% hint style="warning" %}
**This feature is experimental, please make sure you backup your project beforehand.**
{% endhint %}

You can add an **OptimizeForSize** component to your build configuration via the Add Component in the build configuration inspector. It looks like this:

![Optimize For Size component, part of a Build Configuration Asset.](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-59f8bcb5aef3810fd0fd4d692e80eb3d909b890c%2Foptimize%20for%20size.png?alt=media)

Select the desired optimizations depending on your needs.

| Optimization                             | What it does                                                                                                                                                                                                                                                        |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Replace Textures And Sounds With Dummies | Project's textures and sound files are replaced with tiny and lightweight alternatives (dummies). Original assets are copied over to `<project>/Library/coherence/AssetsBackup`. They are restored once the build process has finished.                             |
| Keep Original Assets Backup              | The Assets Backup (found at`<project>/Library/coherence/AssetsBackup`) is kept after the build process is completed, instead of deleted. This will take disk space depending on the size of the project, but it's a safety convenience.                             |
| Compress Meshes                          | Sets Mesh Compression on all your models to High.                                                                                                                                                                                                                   |
| Disable Static Batching                  | Static Batching tries to combine meshes at compile-time, potentially increasing build size. Depending on your project, static batching can affect build size drastically. Read more about [static batching](https://docs.unity3d.com/Manual/DrawCallBatching.html). |

{% hint style="info" %}
Settings applied to built simulators will be reverted once the build process is completed, so these settings won't affect other builds you make.
{% endhint %}

## Upload your simulator

Once you have created a valid simulator build, you can upload it to coherence.

If you built your simulator using the Build tab, you should have a valid path to your simulator build set already. If you haven't or want to use a different path, use the **Browse** button.

![](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-d8beb9b7d5131e02fe93d399dee078401c3aba92%2Fbuild%20upload%20tab.png?alt=media)

You'll see in the developer dashboard when your simulator is ready and running.

![](https://3580906557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUrQ8GJkdHxImzMEWuxaz%2Fuploads%2Fgit-blob-23a341fa08468bcf0fdf36eb08fccbc9b78e6ba8%2Fsim.png?alt=media)

{% hint style="warning" %}
Target frame rate on simulator builds is forced at 30.
{% endhint %}
