Compile and reload from the command line?
Is it possible to trigger a compile and hot reload from the commandline while the editor is running a project?
I mean basicly doing the as pressing the "compile" button within the editor, but triggered from the outside?
asked Jun 15 '17 at 09:19 PM in C++ Programming
Yes, UE4 use it own code build system called UnrealBuildTool (UBT) which you can call out via command line and yes Visual Studio is only needed for compiler that UBT use and you don't need to use IDE at all ("Compile" button shows you that)
For IDE or text editor you should use those bat files
\UnrealEngine\Engine\Build\BatchFiles\Build.bat ProjectNameEditor Win64 Debug "X:\Path\To\The\Project\ProjectName.uproject" -waitmutex
\UnrealEngine\Engine\Build\BatchFiles\Rebuild.bat ProjectNameEditor Win64 Debug "X:\Path\To\The\Project\ProjectName.uproject" -waitmutex
\UnrealEngine\Engine\Build\BatchFiles\Clean.bat ProjectNameEditor Win64 Debug "X:\Path\To\The\Project\ProjectName.uproject"
Replace ProjectName with name of your project. You can replace Debug with different build configuration (which you can check in VS the names of other configurations). The "Editor" surrfix triggers editor build, "Server" will build dedicated server only build, "Client" will build without server code, without surrfix will build ordenery build without editor, you can see those configuration in VS too. "UE4Editor" without uproject typed in will trigger engine with editor build, you can also type in any names from "Programs" (without "Editor" ofcorse)directory and UBT will build it.
UBT it self have use same arguments + it bat has extra checks, look up inside of bat to see properly. clean.bat includes -clean argument which triggers cleaning and rebuild.bat simple runs clean.bat and build.bat is sequence
UBT has lot of argument you can use (for example useful -module argument which let you build single module) they not documented as i know, so you need to hunt them from UBT code which lucky it easy to find as they packed up in single place:
answered Jun 15 '17 at 10:22 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here