Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

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

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

question from:https://stackoverflow.com/questions/11164876/is-there-a-way-export-xcode-build-settings-to-xcconfig-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...