Search Unity

iOS PostProcessBuild using python

Discussion in 'Unity Build Automation' started by Simon_says, Feb 26, 2016.

  1. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    I'm using the mod_pbxproj.py script for executing post process commands when building for iOS. I use it to add external dependencies and frameworks from the folder that's usually on my desktop. How can I do that using the cloud build? My project won't compile in xCode without having this external files included.

    This is my OnPostProcessBuild editor script:

    Code (CSharp):
    1. string sdkPath = "/Users/admin/Desktop/SDK/";
    2.  
    3.         Process pythonProcess = new Process();
    4.         pythonProcess.StartInfo.FileName = "python";
    5.         pythonProcess.StartInfo.Arguments = string.Format("Assets/Editor/post_process.py \"{0}\" \"{1}\"", pathToBuildProject, sdkPath);
    6.  
    7.         UnityEngine.Debug.Log(pythonProcess.StartInfo.Arguments);
    8.  
    9.         pythonProcess.StartInfo.UseShellExecute = false;
    10.         pythonProcess.StartInfo.RedirectStandardOutput = false;
    11.         pythonProcess.Start();
    12.         pythonProcess.WaitForExit();
     
  2. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    You can add the sdk you are trying to include in a folder that lives at the root of your repo, like:
    • project-root
      • Assets/
      • ProjectSettings/
      • SDK/
    After that you would just use the relative path when running your post process. Another alternative to this post process python script is to use the Xcode Manipulation API (bundled with Unity since 5.x) to modify the xcode project appropriately.
     
    Simon_says likes this.