These are the docs for 13.3, an old version of SpatialOS. The docs for this version are frozen: we do not correct, update or republish them. 14.5 is the newest →

Using the Platform SDK locally

The spatial CLI ships with a local API service. This runs as a background daemon on your machine, and allows you to use the Platform SDK to develop tools for local deployments.

You can use the spatial commands to interact with the local API service.

Starting the local API service

To start an instance of the local API service, navigate to your project’s root directory and run spatial service start.

The process runs in the background, and defaults to port 9876. You can change the port the daemon runs on by passing the --port flag. Only one local API service instance can be running on your machine at one time.

To start a local API service instance from outside your project’s directory structure, or if your main configuration file (usually called spatialos.json) isn’t in the project root, you can specify it by passing the --main_config flag.

For example:

# Will run on port 9876 and attempt to find a spatialos.json file in this directory.
spatial service start
# Will run on port 1234, using the project configuration at the provided path.
spatial service start --port 1234 --main_config path/to/project/spatialos.json

Checking the status of the service

You can get information on the running local API service instance, if it exists, using spatial service status.

You can run this command from anywhere - you don’t need to be in a project directory.

Stopping the service

To shut down the running local API service instance, run spatial service stop.

Stopping the local API service also shuts down any locally running deployment that was started with the local API service.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums