- Home /
How to get XCode project from Unity project?
Good day to all.
It is a bit strange, but I can't find any info about how to create an XCode project from unity project using command line. I want to write the shell script, that will create XCode project, then build it, archive, etc. The only thing I don't know is how to get XCode project. Maybe i'm just too tired, but it seems really strange and I don't want to believe that the only way is to do it manually from the unity editor.
I will be glad to get any advice or link about this.
Thanks.
Answer by Bunny83 · Jan 22, 2013 at 06:09 PM
I would try to do something like that:
Create an editor script in your project which will contain a static function which uses BuildPipeline.BuildPlayer to build the player.
Run Unity with those commandline parameters: - -projectPath YourProjectPath - -batchmode - -quit - -executeMethod YourClassName.YourMethodName
You can use System.Environment.GetCommandLineArgs in your editor script to process any additional parameters
Sry for late answer. I've tried what you say but it seems that something is wrong. I created .js script like this one, added it to Assets/Editor folder and run from the command line unity with parameter "-execute$$anonymous$$ethod $$anonymous$$yBuild" (do not post other parameters as they are standard) but do not see any result =( no build folder created, no errors in the ter$$anonymous$$al window =( do you have any thoughts about what i'm doing wrong? (if it is important, i have iOS license and can build ios project from unity editor manually without problems, also i've changed the build target and paths to my scenes in the .js file)
Well you have to specify the classname and the function name seperated by a dot (.).
-execute$$anonymous$$ethod ClassName.$$anonymous$$yBuild
Since it seems you use the sample script from the docs i can't tell you your classname since that's the file name you put the script in.
ps: Just in case you've missed that in the docs:
"To use -execute$$anonymous$$ethod you need to have a script in an Editor folder and a static function in the class."
Answer by Maulik2208 · Jan 25, 2013 at 01:04 PM
Steps to be followed in unity: 1) Switch platform to Iphone 2)go to build setting----> player setting and fill the credentials there 4)now click on Build 5)you will be asked for the path and after few secs. you will get xcode proj of your unity project
Don't forget to mark the answer if Helped........
it seems that you didn't read my question. i'd asked how to create build from the command line, not from the unity editor