Search Unity

Build in Windows from BAT file takes ten minutes

Discussion in 'Editor & General Support' started by lam3001, Nov 26, 2020.

  1. lam3001

    lam3001

    Joined:
    Nov 26, 2020
    Posts:
    5
    Sometimes I build my project in Unity Editor and it takes way less than a minute.

    But I also like to do a command line build and I noticed that takes ten minutes. Is there a way I can fix that so it builds faster? Here is what my command line looks like -- I use powershell so that the batch file does not continue before the build actually finishes. Maybe it has to do with the "-Wait" but if I don't put that in the command line continues before the build finishes.

    Code (WindowsBatch):
    1. powershell -Command "Start-Process -FilePath C:\Users\me\source\Unity\Editors\2019.3.5f1\Editor\Unity.exe -ArgumentList '-batchmode -projectpath C:\Users\me\source\repos\MyProject -buildWindows64Player C:\mybuild\MyProject.exe -quit' -Wait" time /T
     
  2. lam3001

    lam3001

    Joined:
    Nov 26, 2020
    Posts:
    5
    Wow, crickets.

    Could this be somehow related to posts I have seen about not being able to change build targets without waiting for some period of time after a build?
     
  3. lam3001

    lam3001

    Joined:
    Nov 26, 2020
    Posts:
    5
  4. zacharyyates

    zacharyyates

    Joined:
    Jan 5, 2020
    Posts:
    4
    Just wanted to say this solution works great. CI builds are much faster now.