> For the complete documentation index, see [llms.txt](https://docs.coherence.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherence.io/0.8/simulators/testing-simulators-locally.md).

# Testing Simulators Locally

Before deploying a simulation server testing and debugging locally can significantly improve development and iteration times. There are a few ways of accomplishing this.

### Running the editor as a simulator

Using the Unity editor as a simulator allows us to easily debug the simulator. This way we can see logs, examine the state of scenes and game objects and test fixes very rapidly.

To run the Editor as a simulator run the editor from the command line with the proper parameters:

* \--coherence-simulation-server: used to specify the program should run as a coherence simulator.
* \--coherence-ip: tells the simulator which IP it should connect to, using 127.0.0.1 will connect the simulator to a local server if one is running.
* \--coherence-port: specifies the port the simulator will use
* \--coherence-world-id: specifies the world id to connect to, used only when set to worlds.
* \--coherence-room-id: specifies the room id to connect to, used only when set to rooms.
* \--coherence-unique-room-id: specifies the unique room id to connect to, used only when set to rooms.

For example:

```
"Editor Path"
--coherence-simulation-server 
--coherence-ip 127.0.0.1 
--coherence-port 32001 
--coherence-world-id 0 
--coherence-room-id [room-id]
--coherence-unique-room-id [room-uid]

```

If you're not sure which values should be used adding a `COHERENCE_LOG_DEBUG` define symbol will let you see detailed logs, among them are logs that describe which IP, port and such the client is connecting to. This can be done in the Player settings: `Project Settings -> Player -> Other Settings -> Script Compilation -> Scripting Define Symbols`

![](/files/bgnLrd0nWMYEtQ69aKJv)

{% hint style="info" %}
To learn more about simulators see [Simulators](/0.8/simulators/client-vs-simulator-logic.md).
{% endhint %}

### Running a simulator build locally

Another option is making a simulator build and running it locally. This option more closely emulates what will happen when the simulator is running after being uploaded.

You can run a simulator executable build in the same way you run the editor.

```
"simulator build path"
--coherence-simulation-server 
--coherence-ip 127.0.0.1 
--coherence-port 32001 
--coherence-world-id 0 
--coherence-room-id [room-id]
--coherence-unique-room-id [room-uid]
```

This allows you to test a simulator build before it is uploaded or if you are having trouble debugging it.

### Connecting a simulator to a room

When using a rooms-based setup, you first have to create a room in the local replication server (e.g. by using the connect dialog in the client).

The local replication server will print out the **room ID** and **unique room ID** that you can use when connecting the simulator.

![](/files/q5D4bECGoxmxoRpFwS84)

{% hint style="info" %}
To learn more about building simulator build see [Simulators Build and Deploy](/0.8/simulators/build-deploy-simulators.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coherence.io/0.8/simulators/testing-simulators-locally.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
