Is there a way export xcode build settings to .xcconfig file?

前端 未结 2 1114
醉话见心
醉话见心 2020-12-22 20:08

Is it possible to export xcode build settings to .xcconfig file? Other than just copy-paste it to text file line-by-line. Thanks!

相关标签:
2条回答
  • 2020-12-22 20:51

    You don't have to copy-and-paste line-by-line. You can select all and copy all lines at once. The only restriction is you can't copy lines with <multiple values> as a value. That is, if you've got one setting that has specifies a different value for both Debug and Release, etc. you need to deselect just that line (cmd-click) to copy.

    0 讨论(0)
  • 2020-12-22 20:52

    This SO answer helped me.

    Show the package contents of your project file (MyProject.xcodeproj) by two finger clicking on it in finder, then open the 'project.pbxproj' file in a text editor.

    Look for the section XCConfigurationList. It starts with /* Begin XCConfigurationList section */. You will find all your targets and their respective builConfigurations. Now do a find (command - f) on the long hex ID to find the other occurance in the project.pbxproj where you should also find your buildSettings. Copy and paste everything between the buildSettings brackets into your xcconfig file. You will then need to massage some of the variables, specifically the lists of search paths.

    Alternatively, you can use xcodebuild from the command line:

    First to list your schemes:

    xcodebuild -list

    Then export your desired scheme's settings:

    xcodebuild -scheme "schemeName" -showBuildSettings >> mynew.xcconfig

    You will then need to delete the first line or comment it out

    0 讨论(0)
提交回复
热议问题