简体   繁体   中英

Edit Xcode xcconfig file and Cocoapods

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

  1. Make Xcode use multiple xcconfig files
  2. Use my own xcconfig file that includes Pods.xcconfig file

So how to deal with this ?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM