Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automated Unity iOS build on Mac

Tags:

ios

unity3d

I am doing the iOS builds for a group of Unity (Unity3d) game developers.

After pulling the latest git updates, I start up the Unity editor on my Mac and choose "Build Settings", select the iOS target platform, press Build, specify a destination folder and that is it.

Can this exact process be done automatically via the terminal prompt?

like image 617
lox Avatar asked Sep 23 '13 07:09

lox


People also ask

Do Unity builds work on Mac?

Windows Unity Editor makes a Mac build; Windows doesn't have file permissions like macOS does; so the files don't have the "execute" bit set; so when opened on a Mac, it is not allowed to execute.

Do you need Mac to develop iOS Unity?

TLDR: You will need access to a Mac for an initial setup, afterwards you can develop without a mac.

Can Unity develop for iOS?

Build your game for iOS Open Unity, go to File > Build Settings, and select Switch Platform on the bottom of the window. Unity will start making the switch, once it is finished, the Unity icon will appear next to the iOS icon and the Build option will be activated.


2 Answers

What you would need to do is create an editor method in Unity that does the iOS building:

http://docs.unity3d.com/Documentation/ScriptReference/BuildPipeline.BuildPlayer.html

And then call that method via the Unity command line arguments.

http://docs.unity3d.com/Documentation/Manual/CommandLineArguments.html

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod MyEditorScript.MyMethod
like image 74
Calvin Avatar answered Oct 10 '22 11:10

Calvin


As Calvin said, you can use the executeMethod switch of Unity's command line to call your own C# command and have some build logic executed. I have written a small article about how to do this. There is also a cheat sheet showing the Unity API to use for specific tasks.

like image 35
Jan Thomä Avatar answered Oct 10 '22 12:10

Jan Thomä