Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jun 27, 2012 at 08:47 AM by Senhor de todo o Mal for the following reason:

The question is answered, right answer was accepted

avatar image
5
Question by Senhor de todo o Mal · Aug 18, 2011 at 06:43 PM · compilebuildpipelinecommand-linebuildplayer

Build Player from Command Line

I've made a batch file with the following command line:

 "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformBuild

Which calls the following method:

 static void PerformBuild ()
 {
 
            string[] scenes = { "1.unity","2.unity","3.unity","4.unity","5.unity" };
         BuildPipeline.BuildPlayer(scenes,"win.exe",BuildTarget.StandaloneWindows,BuildOptions.None);
         BuildPipeline.BuildPlayer(scenes,"osx.app",BuildTarget.StandaloneOSXUniversal,BuildOptions.None);
           BuildPipeline.BuildPlayer(scenes,"WebPlayer.unity3d",BuildTarget.WebPlayerStreamed,BuildOptions.None);
         scenes = null;
 
 }

It does build the three players but unfortunately it only compiles one of them.

Is there anyway to force compile before building? Am I missing something?

EDIT:

I tried separating in different functions and different calls and the same thing happens, I get the 3 builds but only one has been compiled, the other 2 act as if there were no changes to the code.

 "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWebBuild
 "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWindowsBuild
 "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWebBuild
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BerggreenDK · Aug 18, 2011 at 08:00 PM 0
Share

which one is it compiling btw.?

avatar image Senhor de todo o Mal · Aug 19, 2011 at 08:26 AM 0
Share

The last build platform I had selected on the build settings.

avatar image KvanteTore · Oct 26, 2011 at 10:04 AM 0
Share

have you had any success with this? What if you touch one of your code files between each call in the batch file?

avatar image Soviut · Jun 27, 2012 at 12:21 AM 0
Share

Just as a note about C#, you don't need to null the scenes variable. It will be garbage collected the same way in either case. Nulling variables does NOT provide any hints to the garbage collector.

2 Replies

  • Sort: 
avatar image
2
Best Answer

Answer by KvanteTore · Oct 26, 2011 at 11:31 AM

Presumably, you can use EditorUserBuildSettings.SwitchActiveBuildTarget to set the active build target before you build. I haven't tried it but I came across the method and thought about your problem :)

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Senhor de todo o Mal · Oct 26, 2011 at 12:43 PM 0
Share

I'll have to try that.

avatar image Senhor de todo o Mal · Oct 26, 2011 at 02:49 PM 0
Share

It works :)

avatar image kakyounity · Jan 12, 2013 at 04:06 AM 0
Share

$$anonymous$$ay I know how it can work? Because I tried it in my build script by putting it right before the BuildPlayer call, and it doesn't work.

avatar image
0

Answer by BerggreenDK · Aug 18, 2011 at 07:59 PM

If you place the command in a command file, eg. "compileall.cmd" and then make a function for each platform.

Then you can auto compile all three just by clicking on the CMD file.

would that be enough?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Senhor de todo o Mal · Aug 19, 2011 at 08:32 AM 0
Share

Won't that be the same as I have? I'll try it anyway.

avatar image Senhor de todo o Mal · Aug 19, 2011 at 09:00 AM 0
Share

Same exact problem

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Update to 5.3.4f1 executeMethod couldn't be find in Command line arguments 0 Answers

Build Fails Due To Unity Crash: Out Of Memory 2 Answers

Get a list of scenes in Build settings 0 Answers

Command line flag to build WebGL 3 Answers

xr plugin managment arkit required script 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges