Testing code changes - MozillaReality/servo-unity GitHub Wiki
A code – build – run – test – read log cycle:
macOS:
- Open plugin Xcode project
- Build Xcode project. This first removes the previous plugin build (ServoUnity.bundle) from Unity project’s plugins folder. A successful build places ServoUnity.bundle into the Unity project’s plugins folder
- Launch Unity (typically via Unity Hub) and open Unity project.
- To launch with Rust debug logging, use this macOS script (Unity will inherit the environment from Unity Hub):
#!/bin/bash
export RUST_BACKTRACE=1
export RUST_LOG=debug
nohup "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub" &>/dev/null &
- Either: run project in Unity Editor (press play), or: build and run project standalone via Unity runtime.
- Afterwards, you can examine the Unity log, including plugin log output and stdout/stderr via either
~/Library/Logs/Unity/Editor.log
or ~/Library/Logs/Mozilla/ServoUnity/Player.log
Windows:
- Open plugin Visual Studio project
- Build Visual Studio project. A successful build places servo_unity.dll directly into the Unity project’s plugins folder, overwriting any previous version.
- Launch Unity (typically via Unity Hub) and open Unity project.
- To launch with Rust debug logging, open a command window as administrator and then type:
setx RUST_BACKTRACE 1 /m
Setx RUST_LOG debug /m
- Either: run project in Unity Editor (press play), or: build and run project standalone via Unity runtime.
- Afterwards, you can examine the Unity log, including plugin log output and stdout/stderr via either
%APPDATA%\Local\Unity\Editor\Editor.log
or %APPDATA%\Local\Mozilla\ServoUnity\Player.log
.