Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Testing code changes

Philip Lamb edited this page Aug 5, 2020 · 1 revision

A code – build – run – test – read log cycle:

macOS:

  1. Open plugin Xcode project
  2. 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
  3. Launch Unity (typically via Unity Hub) and open Unity project.
  4. 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 &
  1. Either: run project in Unity Editor (press play), or: build and run project standalone via Unity runtime.
  2. 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:

  1. Open plugin Visual Studio project
  2. Build Visual Studio project. A successful build places servo_unity.dll directly into the Unity project’s plugins folder, overwriting any previous version.
  3. Launch Unity (typically via Unity Hub) and open Unity project.
  4. 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
  1. Either: run project in Unity Editor (press play), or: build and run project standalone via Unity runtime.
  2. 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.
Clone this wiki locally