# 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.&#x20;

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

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

![](https://1930722764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWd0ZPEK7vE9nkE0b7G-1552174847%2Fuploads%2FfLN6PZICfpILfWMWIoTq%2Fimage.png?alt=media\&token=b585514c-fa0f-438d-80cf-f5681d03b5f9)

From within the **Build Wizard** you can build and upload simulators.&#x20;

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

![](https://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MYxr5uw9Eki_p0zElzj%2F-MYxzcGXTovgOKtFqlks%2Fsimulator%20window.png?alt=media\&token=895700d5-6740-425d-9076-c34b2ab4f058)

The **Build** tab creates valid simulator builds from **Build Configuration Assets.**&#x20;

![](https://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MYxr5uw9Eki_p0zElzj%2F-MYy3QI0NmcCR3LitFrP%2Fsimulator%20build%20tab.png?alt=media\&token=77bdfbcd-9633-4374-b31e-feea0893d2bf)

{% 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.&#x20;
{% 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://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MYyYgiNgZ9MilW-6Bds%2F-MYy1zyIfuQYUBm-g18n%2Fbuild%2520config%2520asset.png?alt=media\&token=b9e663b4-f7fa-48ae-ba28-f4f69f1ab5c7)

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).&#x20;

#### 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://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MYxr5uw9Eki_p0zElzj%2F-MYy3wP9XeufmwJpKIa_%2Foptimize%20for%20size.png?alt=media\&token=37333600-1a19-49de-af33-a542b4d542d5)

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&#x20;

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://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MYxr5uw9Eki_p0zElzj%2F-MYyFAkBWoQysTe9mMut%2Fbuild%20upload%20tab.png?alt=media\&token=61e8a1e4-c35b-4b8f-9860-b885d3df276e)

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

![](https://1930722764-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MWd0ZPEK7vE9nkE0b7G%2F-MeQ5L3pyZQBY_npBimJ%2F-MeQ7cNpXcOLOHLEOiOJ%2Fsim.png?alt=media\&token=5794a426-6732-4716-a92a-a20fa98180b3)

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