This guide covers common issues and how to resolve them.
Symptoms:
- Error: "Failed to start bridge"
- Error: "Port already in use"
Solutions:
-
Check if port is already in use:
# Windows netstat -ano | findstr :49521 # Linux/Mac lsof -i :49521
If a process is using the port, either kill it or let the bridge auto-assign a different port.
-
Verify you're in a Unity project directory:
# Check for Unity project marker ls ProjectSettings/ProjectVersion.txtIf not found, use
--projectflag:unityctl bridge start --project /path/to/unity-project
-
Check bridge logs:
- Look for error messages in bridge output
- Check if .NET 10.0 runtime is installed:
dotnet --version
-
Kill existing bridge processes:
# Windows taskkill /F /IM unityctl-bridge.exe # Linux/Mac pkill -f unityctl-bridge
Symptoms:
unityctl bridge statusshows bridge is not running.unityctl/bridge.jsonexists but bridge is dead
Solutions:
-
Check if process is actually running:
# Read PID from bridge.json cat .unityctl/bridge.json # Check if process exists (Windows) tasklist | findstr <PID> # Check if process exists (Linux/Mac) ps -p <PID>
-
Clean up stale config:
rm -rf .unityctl unityctl bridge start
-
Restart the bridge:
unityctl bridge start --project .
Symptoms:
- No
[UnityCtl]logs in Unity console - Unity Editor is open but CLI shows "Unity not connected"
Note: The Unity plugin uses exponential backoff when attempting to reconnect to the bridge. Connection attempts occur at intervals of 1s, 2s, 4s, 8s, up to a maximum of 15 seconds between attempts. If the bridge was just started, allow up to 15 seconds for Unity to reconnect.
Solutions:
-
Check bridge is running:
unityctl bridge status
Expected output:
Bridge Status: Running PID: 12345 Port: 49521 Unity Connected: Yes -
Verify bridge.json exists:
cat .unityctl/bridge.json
If missing, restart the bridge.
-
Check Unity console for errors:
- Look for
[UnityCtl]messages - Check for WebSocket connection errors
- Enable "Error Pause" to catch exceptions
- Look for
-
Restart Unity Editor:
- Close Unity completely
- Ensure bridge is running
- Reopen Unity project
- Check console for
[UnityCtl] Connectedmessage
-
Check Unity package is installed:
- Open Package Manager (Window → Package Manager)
- Look for "Unity Ctl" in the list
- Verify
Packages/manifest.jsonincludes:"com.dirtybit.unityctl": "https://github.com/DirtybitGames/unityctl.git?path=UnityCtl.UnityPackage#v0.1.0"
-
Check for Unity errors:
- Look for compilation errors in Unity console
- Ensure all scripts compile successfully
- Try: Assets → Reimport All
Symptoms:
- Unity console shows
[UnityCtl] Connectedthen[UnityCtl] Disconnected - Connection drops immediately
Solutions:
-
Check for Unity Editor crashes:
- Look for crash logs in Unity console
- Check Unity Hub for crash reports
-
Check bridge logs:
- Look for WebSocket errors
- Check for authentication issues
-
Firewall/Antivirus:
- Ensure localhost connections are allowed
- Try temporarily disabling firewall/antivirus
Symptoms:
- Error: "Request timed out after 30s"
- Commands take too long to execute
Solutions:
-
Ensure Unity Editor window has focus:
- Some Unity operations require the Editor window to be focused
- Click on Unity Editor window before running command
-
Check if Unity is responsive:
- Unity may be frozen or stuck
- Look for "Not Responding" in window title (Windows)
- Check Activity Monitor/Task Manager for high CPU usage
-
Check for errors in Unity console:
- Look for exceptions or errors
- Check if Unity is waiting for user input (dialogs, etc.)
-
Try a simpler command first:
unityctl bridge status unityctl play status
Symptoms:
- Command executes but returns error response
- Unity console shows errors
Solutions:
-
Check scene path is correct:
# List all scenes unityctl scene list --source all # Use exact path from list unityctl scene load Assets/Scenes/Main.unity
-
Check asset path is valid:
# Verify asset exists in Unity project ls Assets/Textures/logo.png -
Check play mode state:
- Can't load scenes while in play mode
- Exit play mode first:
unityctl play exit
-
Check Unity console for detailed errors:
- Unity may provide more context
- Look for stack traces
Symptoms:
- Commands work initially
- After script changes, commands timeout or fail
- Unity console shows recompilation messages
Solutions:
-
Wait for reconnection:
- Plugin automatically reconnects after domain reload
- Initial reconnection attempt is immediate after domain reload
- If connection fails, the plugin uses exponential backoff (1s, 2s, 4s... up to 15s max)
- Check Unity console for
[UnityCtl] Connectedmessage
-
Check reconnection succeeded:
unityctl bridge status
Should show "Unity Connected: Yes"
-
Manual reconnection:
- Restart Unity Editor if auto-reconnect fails
- Bridge survives domain reload, no need to restart it
-
Check for compilation errors:
- Domain reload may have failed due to errors
- Fix all compilation errors in Unity console
- Wait for successful recompilation
Symptoms:
- Error: "Package not found"
- Error: "Invalid package source"
Solutions:
-
Check .NET SDK version:
dotnet --version
Requires .NET 10.0 or later.
-
Check NuGet package exists:
- Visit https://www.nuget.org/packages/UnityCtl.Cli
- Verify package version exists
-
Clear NuGet cache:
dotnet nuget locals all --clear
-
Try with explicit version:
dotnet tool install -g UnityCtl.Cli --version 0.1.0
Symptoms:
- Package Manager shows error
- "No packages found" in Unity
Solutions:
-
Check Git URL is correct:
"com.dirtybit.unityctl": "https://github.com/DirtybitGames/unityctl.git?path=UnityCtl.UnityPackage#v0.1.0"
-
Check Git is installed:
git --version
Unity requires Git for Git-based packages.
-
Try Git credential helper:
- Package Manager may need Git credentials
- Set up SSH keys or credential manager
-
Try manual clone:
git clone https://github.com/DirtybitGames/unityctl.git
Then use local path:
"com.dirtybit.unityctl": "file:../unityctl/UnityCtl.UnityPackage"
Bridge:
# Not yet implemented - coming soon
unityctl bridge start --verboseUnity: Add this to Unity console to see all messages:
// In Unity Editor console
Debug.Log("UnityCtl debug enabled");CLI:
# Use --json for structured output
unityctl --json bridge statusIf you've tried these solutions and still have issues:
-
Check GitHub Issues:
- Search existing issues: https://github.com/DirtybitGames/unityctl/issues
- Your problem may already be reported
-
Create a new issue with:
- UnityCtl version (
unityctl --version) - Unity version
- Operating system
- Steps to reproduce
- Error messages
- Relevant logs
- UnityCtl version (
-
Include diagnostic info:
# Bridge status unityctl bridge status # Check tool installation dotnet tool list -g | grep UnityCtl # Check .NET version dotnet --version # Check Unity logs (last 50 lines) unityctl logs -n 50