How can I compile a Unity3D game project from command line into WebGL?

Viewed 15288

I have achieved to compile it into Windows or Mac, but no luck with WebGL.

See my lines for

From Windows to Windows (place them in a .bat file)

set mypath=%cd%
@echo %mypath%
"C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -logFile stdout.log -projectPath %mypath% -buildWindowsPlayer "builds\mygame.exe"

From Linux to Windows (place them in a .sh file)

#/bin/bash
projectPath=`pwd`
xvfb-run --auto-servernum --server-args='-screen 0 1024x768x24:32' /opt/Unity/Editor/Unity -batchmode -nographics -logfile stdout.log -force-opengl -quit -projectPath ${projectPath} -buildWindowsPlayer "builds/mygame.exe"

From Windows or Linux to Mac: Replace -buildWindowsPlayer with -buildOSXPlayer and mygame.exe with mygame.app

However, I having troubles for WebGL. The documentation of Unity3D: https://docs.unity3d.com/Manual/CommandLineArguments.html does not provide any help

there is the command parameter -buildTarget webgl
but nothing happens with that.

HEEEEEEEELLLLLLLLLLLLLPPPPPPP !!!! :(

1 Answers
Related