Repository navigation
Troubleshooting
Common issues and solutions for Unity Remote Server.
Symptoms:
- Cannot connect to http://127.0.0.1:8787
- No response from health endpoint
Solutions:
-
Check Unity Console for errors: Look for any error messages in the Unity Console window.
-
Verify package installation:
- Open Package Manager (Window > Package Manager)
- Check if "Unity Remote Server" is listed
- If not, add via git URL:
https://github.com/dsgarage/UnityRemoteServer.git
-
Check port availability:
# macOS/Linux lsof -i :8787 # Windows netstat -ano | findstr :8787
If port is in use, either:
- Stop the conflicting process
- Or change the port in configuration
-
Restart Unity Editor: Sometimes a fresh restart resolves initialization issues.
Solutions:
-
Find and kill the process:
# macOS/Linux lsof -i :8787 kill -9 <PID> # Windows netstat -ano | findstr :8787 taskkill /PID <PID> /F
-
Change the port:
// In an Editor script [InitializeOnLoad] public static class ChangeServerPort { static ChangeServerPort() { DSGarage.UnityRemoteServer.RemoteServer.Port = 8788; } }
Possible causes:
- Unity Editor not running
- Remote Server package not installed
- Firewall blocking connection
Solutions:
-
Ensure Unity is running: The server only runs when Unity Editor is open.
-
Check firewall settings: Allow Unity Editor through firewall for local connections.
-
Test with curl:
curl -v http://127.0.0.1:8787/health
Solutions:
-
Increase timeout values:
curl -X POST http://127.0.0.1:8787/awaitCompile \ -H "Content-Type: application/json" \ -d '{"timeoutSec": 300}'
-
Check Unity's responsiveness:
- Is Unity Editor frozen?
- Are there infinite loops in your code?
- Check CPU usage
Solutions:
-
Check for compilation errors:
curl http://127.0.0.1:8787/errors?level=error -
Clear Unity's cache:
- Close Unity
- Delete
Library/ScriptAssembliesfolder - Reopen Unity
-
Force reimport:
curl -X POST http://127.0.0.1:8787/refresh \ -H "Content-Type: application/json" \ -d '{"force": true}'
Solutions:
-
Check Unity Console: Build errors might only appear in Unity Console.
-
Verify build settings:
- Open Build Settings in Unity
- Ensure scenes are added
- Check platform is properly configured
-
Check disk space: Ensure sufficient disk space for build output.
Example error:
SyntaxError: Unexpected token < in JSON at position 0
Solutions:
-
Check response content:
curl -v http://127.0.0.1:8787/endpoint
-
Verify Content-Type header:
curl -X POST http://127.0.0.1:8787/endpoint \ -H "Content-Type: application/json" \ -d '{}'
Solutions:
-
Check endpoint path: Ensure you're using the correct endpoint path.
-
List available endpoints:
// In Unity Console var endpoints = DSGarage.UnityRemoteServer.RemoteServer.GetEndpoints(); foreach (var endpoint in endpoints) { Debug.Log(endpoint); }
Solutions:
-
Check Unity's performance:
- Open Profiler (Window > Analysis > Profiler)
- Look for performance bottlenecks
-
Reduce log verbosity:
DSGarage.UnityRemoteServer.RemoteServer.EnableDebugLogging = false;
-
Limit log entries:
DSGarage.UnityRemoteServer.LogStore.MaxEntries = 100;
Solutions:
-
Clear logs periodically:
curl -X POST http://127.0.0.1:8787/errors/clear
-
Reduce log buffer:
LogStore.MaxEntries = 200; // Reduce from default
Solutions:
-
Install jq:
# macOS brew install jq # Ubuntu/Debian sudo apt-get install jq # Windows (via Chocolatey) choco install jq
-
Use Python script instead: Python scripts don't require jq.
Solutions:
-
Make scripts executable:
chmod +x Scripts/*.sh -
Run with bash explicitly:
bash Scripts/unity-build.sh android output.apk
Issue: "Unity is damaged and can't be opened"
Solution:
xattr -cr /Applications/Unity/Hub/Editor/2022.3.10f1/Unity.appIssue: "Operation not permitted"
Solution: Grant Unity full disk access in System Preferences > Security & Privacy.
Issue: "Windows Defender blocks Unity"
Solution: Add Unity installation folder to Windows Defender exclusions.
Issue: "Long path issues"
Solution: Enable long path support:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -ForceIssue: "No display found"
Solution for headless systems:
xvfb-run -a Unity -batchmode -projectPath .Enable debug logging for troubleshooting:
// In Unity Editor script
[InitializeOnLoad]
public static class EnableDebugMode
{
static EnableDebugMode()
{
DSGarage.UnityRemoteServer.RemoteServer.EnableDebugLogging = true;
Debug.Log("Remote Server debug mode enabled");
}
}If you're still experiencing issues:
- Check Unity Console for error messages
-
Review server logs:
curl http://127.0.0.1:8787/errors?level=all - Enable debug mode (see above)
- Create an issue on GitHub
When reporting issues, include:
- Unity version
- Operating system
- Error messages
- Steps to reproduce
- Relevant code snippets
| Error | Cause | Solution |
|---|---|---|
| "ECONNREFUSED" | Server not running | Start Unity Editor |
| "ETIMEDOUT" | Server not responding | Check Unity is not frozen |
| "EADDRINUSE" | Port already in use | Change port or kill process |
| "401 Unauthorized" | Authentication required | Add API key to request |
| "500 Internal Server Error" | Server error | Check Unity Console for details |
| "Compilation in progress" | Unity is compiling | Wait or increase timeout |
Q: Can I run multiple Unity instances with Remote Server? A: Yes, but each needs a different port number.
Q: Does Remote Server work with Unity Cloud Build? A: No, it requires a local Unity Editor instance.
Q: Can I access Remote Server from another machine? A: By default no (security). You can modify binding address but it's not recommended.
Q: Why do some endpoints return HTML instead of JSON? A: This usually means the endpoint doesn't exist (404 page). Check the endpoint path.