Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Adding libs to cloud build iOS

Discussion in 'Unity Build Automation' started by kujo, Apr 20, 2016.

  1. kujo

    kujo

    Joined:
    Aug 19, 2013
    Posts:
    106
    Hi,

    I'm trying to add in Google Analytics into my project, but the post build script provided by Google doesn't seem to include the required files. It tries to add in libz.dylib and libsqlite.dylib. Now I know these have changed in the new Xcode to tdb files and I've managed to get the project building locally, but how can I add these files in for a cloud build? I've tried changing the file to add in the tdb files instead, but it doesn't seem to work.

    The (slightly modified) GA post build script is as follows:

    Code (csharp):
    1.  
    2. #!/usr/bin/python
    3.  
    4. #Add required libraries to Xcode project during build for Google Analytics
    5. from mod_pbxproj import *
    6. from os import path, listdir
    7. from shutil import copytree
    8. import sys
    9.  
    10. frameworks = [
    11.               'AdSupport.framework',
    12.               'CoreData.framework',
    13.               'SystemConfiguration.framework',
    14.               'libz.tbd',
    15.               'libsqlite3.0.tbd'
    16.               ]
    17.  
    18. framework_dir = path.join(sys.argv[0],'..','..','Plugins','iOS')
    19.  
    20.  
    21.  
    22. pbx_file_path = sys.argv[1] + '/Unity-iPhone.xcodeproj/project.pbxproj'
    23. pbx_object = XcodeProject.Load(pbx_file_path)
    24.  
    25. pbx_object.add_framework_search_paths([path.abspath(framework_dir)])
    26.  
    27. for framework in frameworks:
    28.     pbx_object.add_file('System/Library/' + framework, tree='SDKROOT')
    29.  
    30. pbx_object.save()
    31.  
     
    Last edited: Apr 20, 2016
  2. kujo

    kujo

    Joined:
    Aug 19, 2013
    Posts:
    106
    Got it sorted using the Xcode API