The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Automated Unity build
Anyone had success using command line build for Unity? I think I'm close but still having issues getting /App output.
using UnityEditor; class Builder { static void Build() { string[] scenes = { "Assets/myScene.unity" }; string buildPathLocation ="/App"; BuildTarget buildTarget= BuildTarget.WSAPlayer ; BuildOptions buildOptions = BuildOptions.None; BuildPipeline.BuildPlayer(scenes, buildPathLocation, buildTarget, buildOptions); } }
Command line:
Unity.exe -nographics -batchmode -projectPath "C:\Projects\UnityTest\UnityTest" -logFile "C:\Unitylog.txt" -executeMethod Builder.Build
N6MAA10816
Best Answers
-
OptionsContextVR ✭✭✭
@CarSunKey You may want to add "public" to both Builder class and static Build method.
First make sure your script works in the Unity editor and then invoke it from the command line. You'll need to put the build script inside a special folder called "Editor" which can be located anywhere in the project.
`
// Path: Assets/Editor/Builder.cs
using UnityEditor;public class Builder : ScriptableObject
{
[MenuItem ("Build/HoloLens")]
public static void BuildForHoloLens()
{
...
}
}
`5 -
Options
thanks Holo toolkit !!!
https://github.com/Microsoft/HoloToolkit-Unity/commit/bef9230b939b2dc257aee23e3094dfb953a5a515
N6MAA10816
6
Answers
Tried some powershell trickery but no luck. Going to fall back to Autohotkey for Unity followed by powershell for VS. Should save a few miles on my keyboard/mouse
N6MAA10816
I remember trying something similar in Unity using power shell:
Unity.exe -projectPath $samplesDir\$dir -quit -batchmode -executeMethod PerformBuildScript.PerformBuild
Should not but I wonder if changing the scene name to Main.unity helps?
Looked into
Install Universal Windows Apps with the **WinAppDeployCmd ** tool https://msdn.microsoft.com/en-us/library/mt203806.aspx
but it was unable to find the HMD on the network.
Will try the REST API next
N6MAA10816
@CarSunKey You may want to add "public" to both Builder class and static Build method.
First make sure your script works in the Unity editor and then invoke it from the command line. You'll need to put the build script inside a special folder called "Editor" which can be located anywhere in the project.
`
// Path: Assets/Editor/Builder.cs
using UnityEditor;
public class Builder : ScriptableObject
{
[MenuItem ("Build/HoloLens")]
public static void BuildForHoloLens()
{
...
}
}
`
thanks Holo toolkit !!!
https://github.com/Microsoft/HoloToolkit-Unity/commit/bef9230b939b2dc257aee23e3094dfb953a5a515
N6MAA10816