Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Export iOS Workspace from batchmode

Discussion in 'Editor & General Support' started by iPickle, Nov 21, 2020.

  1. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    I hope this is the right place for this...

    I am attempting to automate parts of my workflow, so I am trying to export iOS xcode project
    I have things like facebook and firebase which require to open the project from workspace to compile properly.

    I've set the Play Service Resolver -> iOS -> Settings to add to workspace.

    If I manually open the unity project and export xcode, I get the workspace file as expected.
    If I build from batchmode, I only get the xproject file

    the command I use to build:

    /Applications/Unity/Hub/Editor/2020.1.13f1/Unity.app/Contents/MacOS/Unity -batchmode -quit -projectPath {PATH-TO-PROJECT} -executeMethod ExportTool.ExportXcodeProject logFile "export.log" -username {USERNAME} -password {PASSWORD} -serial {UNITY_SERIAL}


    My export method:

    Code (CSharp):
    1. class ExportTool
    2. {
    3.     static void ExportXcodeProject()
    4.     {
    5.         EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, BuildTarget.iOS);
    6.  
    7.         EditorUserBuildSettings.symlinkLibraries = false;
    8.         EditorUserBuildSettings.development = false;
    9.         EditorUserBuildSettings.allowDebugging = false;
    10.      
    11.         List<string> scenes = new List<string>();
    12.         foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
    13.         {
    14.             if (!scene.enabled)
    15.                 continue;
    16.             scenes.Add(scene.path);
    17.         }
    18.  
    19.         BuildPipeline.BuildPlayer(scenes.ToArray(), "{PATH_TO_PROJECT}", BuildTarget.iOS, BuildOptions.None);
    20.     }
    21. }
    22.  
    I'm probably missing something...
    Thanks :)
     
  2. Nokobot

    Nokobot

    Joined:
    Jun 15, 2017
    Posts:
    13
    We've had the same problem, unity is not consistent at all
    We also had a project that fails "build and run" with shader error, but just "build" works

    I guess you need to find a way around it
     
  3. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    .... Bump?
     
  4. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    I'll try my luck one more time...