A lightweight, zero-configuration HTTP server for Unity Editor that enables remote control and automation through REST APIs. Perfect for CI/CD pipelines, automated testing, and remote development workflows.
- π Zero Configuration - Automatically starts with Unity Editor
- π§ Build Automation - Remote builds for iOS, Android, and other platforms
- π Real-time Log Streaming - Monitor Unity console logs with level filtering
- π Asset Management - Refresh, reimport, and track compilation status
- π― Editor Control - Execute menu items and editor operations remotely
- π Secure by Default - Localhost-only binding for security
- π Extensible API - Easy to add custom endpoints
- π§΅ Thread-Safe - Proper threading model for Unity's main thread
- Open Unity Package Manager (Window > Package Manager)
- Click "+" β "Add package from git URL"
- Enter:
https://github.com/dsgarage/UnityRemoteServer.git
- Download the latest
.unitypackage
from Releases - Import into Unity via Assets > Import Package > Custom Package
cd YourUnityProject/Packages
git clone https://github.com/dsgarage/UnityRemoteServer.git com.dsgarage.unity-remote-server
openupm add com.dsgarage.unity-remote-server
Once installed, the server automatically starts on http://127.0.0.1:8787
when Unity Editor launches.
curl http://127.0.0.1:8787/health
# Response: {"ok":true,"version":"1.0.0"}
π Note: Example automation scripts are provided in
Examples/Scripts/
directory. These should be used outside your Unity project (in CI/CD pipelines, build servers, etc.)
# Refresh assets
curl -X POST http://127.0.0.1:8787/refresh \
-H "Content-Type: application/json" \
-d '{"force":true}'
# Get compilation errors
curl "http://127.0.0.1:8787/errors?level=error"
# Build for Android
curl -X POST http://127.0.0.1:8787/build \
-H "Content-Type: application/json" \
-d '{
"platform": "android",
"outputPath": "Builds/game.apk",
"scenes": ["Assets/Scenes/Main.unity"]
}'
Endpoint | Method | Description |
---|---|---|
/health |
GET | Server health check |
/refresh |
POST | Refresh Unity assets |
/awaitCompile |
POST | Wait for compilation to complete |
/errors |
GET | Get Unity console logs |
/errors/clear |
POST | Clear console logs |
/build |
POST | Build project for target platform |
level
: Filter by log level (error
,warning
,log
,all
)limit
: Maximum number of entries (default: 200)
Example: /errors?level=error&limit=50
using DSGarage.UnityRemoteServer;
[InitializeOnLoad]
public static class RemoteServerConfig
{
static RemoteServerConfig()
{
RemoteServer.Port = 9090; // Custom port
RemoteServer.EnableDebugLogging = true;
}
}
using DSGarage.UnityRemoteServer;
[InitializeOnLoad]
public static class MyCustomEndpoints
{
static MyCustomEndpoints()
{
RemoteServer.RegisterCustomEndpoint("/api/custom", HandleCustomRequest);
}
static void HandleCustomRequest(HttpListenerContext ctx)
{
var response = new { message = "Hello from custom endpoint!" };
RemoteServer.WriteJson(ctx, 200, JsonUtility.ToJson(response));
}
}
# GitHub Actions example
- name: Wait for Unity
run: |
until curl -s http://127.0.0.1:8787/health; do sleep 1; done
- name: Build Game
run: |
curl -X POST http://127.0.0.1:8787/build \
-H "Content-Type: application/json" \
-d '{"platform": "android", "outputPath": "build.apk"}'
// JavaScript test runner example
async function runUnityTests() {
await fetch('http://127.0.0.1:8787/refresh', { method: 'POST' });
await fetch('http://127.0.0.1:8787/awaitCompile', { method: 'POST' });
const errors = await fetch('http://127.0.0.1:8787/errors?level=error');
if (errors.length > 0) {
throw new Error('Unity has compilation errors');
}
}
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Unity Technologies for the Unity Editor
- Contributors and users of this project
- Open source community
Made with β€οΈ by DS Garage