add CoreTelephony to your iOS project from unity?

how can I add automatically CoreTelephony to the xcode project when I build from unity3d?


You will need to do this via a post-process build script. See: BuildPlayerPipeline documentation to get you started.

An example python script would be something like the below script.


  • This script has not been tested.

  • You may need to change paths to suit your project/computer.

  • You will need to have the mod_pbxproj python script in the same folder as your post process build script. It is an open source script so you should be able to search for it and easily get it.


    import sys
    import shutil

    from mod_pbxproj import XcodeProject

    projectPath = sys.argv1

    project = XcodeProject.Load(projectPath + ‘/Unity-iPhone.xcodeproj/project.pbxproj’)

    project.add_file_if_doesnt_exist(‘System/Library/Frameworks/CoreTelephony.framework’, tree=‘SDKROOT’)