I want to edit the xcconfig file, but unfortunately Xcode only allows 1 xcconfig file per configuration, and that is Pods.xcconfig because I'm using Cocoapods
So how can I edit the xcconfig without hurting Cocoapods
I can think of several ways
So how to deal with this ?
Creating and using your xcconfig file To create an xcconfig file, choose File -> New -> File... in your project. In the new file dialog, scroll down until you see the Configuration Settings File in the Other section. You can add configurations for pretty much anything you want.
After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.
If you don't know what an Xcode Configuration file ( . xcconfig ) is, it is actually a key/value based file. You can store your build settings in the form of key/value pairs, similar to what you did in dictionaries. By using a . xcconfig file, it is very easy to define build parameters for each build.
<What is a Podfile? The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. The file should simply be named Podfile . All the examples in the guides are based on CocoaPods version 1.0 and onwards.
Nowadays (XCode 9.x, CocoaPods 1.4.0) you just add
#include "Pods/Target Support Files/Pods-MyApp/Pods-Pods-MyApp.debug.xcconfig"
to your custom xcconfig. pod install
will complain but automatically do the right thing (nothing); it'll even tell us to do exactly the above.
It's not necessary anymore to prevent integration (which would leave us without a workspace, too). FWIW, option --no-integrate
no longer exists; if we wanted it, we'd add :integrate_targets => false
as option to install!
in the Podfile.
Here is a issue in CocoaPods Tracker. A workaround is described here: #1736.
As kylef (owner of CocoaPods repo) mentioned:
Manual Workaround: Use
pod install --no-integrate
then add#include "Pods/Pods-GCE.xcconfig"
from your custom xcconfig files.I don't think there is a clear solution to automatically fix it, but maybe it would be nice if cocoa pods detected this and told the user. Took me a while to figure out what happened after I did
pod install
and the projects xcconfig files wasn't being included.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With