I have an iOS\/OS X Xcode projects, where I'm using CocoaPods, and I can't seem to figure out how to add my own project configurations (In addition to Debug and Release) without completely blowing up the build.
The Xcode workspace of course also has the Pods project.
My Podfile looks something like this:
source 'https://github.com/CocoaPods/Specs.git'
target :iOS do
platform :ios, '7.1'
link_with 'iOS', 'NozbeToday', 'NozbeShare', 'NozbeWatch'
# pods...
end
target :Mac do
platform :osx, '10.9'
link_with 'Mac'
# pods...
end
OK, so half-way through writing this question I figured it out myself (yay rubber ducking). Here's the solution for next generations:
Essentially, you have to add an explicit dependency on the Pods target to your application scheme.
The way you do it, is: edit your application scheme, go to the Build section, and add the Pods target above your application target. You should see something like this:
And it will just work.
As for the CocoaPods warnings on pod install
, you need to use the xcconfig
files generated by CP for each of your Xcode configurations. The way you do it is:
Pods/Target Support Files
You'll also need something like this in your Podfile to let CocoaPods know which of your Xcode configurations are "debug" (unoptimized), which are "release":
project '1Nozbe', {
'iOS 1 Dev Debug' => :debug,
'iOS 2 Dev AdHoc' => :release,
'iOS 3 Release Debug' => :debug,
'iOS 4 Release AdHoc' => :release,
'iOS 5 Release AppStore' => :release,
}
Not exactly related to CocoaPods, but if you happen to have some other (sub-project) dependencies other than CP, you'll also need to do two things:
Add this line in your config file, just like import a header file:
#include "Pods/Target Support Files/Pods/Pods.debug.xcconfig"
NOTE: it's #include
, not #import
Another solution without the need to add explict dependencies to any schema nor draging and dropping stuff:
How to add custom project configurations to Xcode when using CocoaPods
Usually when you add custom configurations to your xcode project (other than Debug and Release) the thing you should do is run pod install
. This will fix/remake the changes that cocoapods usually do.
How to get ride of CocoaPods did not set the base configuration of your project because...
warning
On the Configurations
settings under Info
tab, on project level, you need to set the base configuration to use (generated when running pod install)
And dont forget to tell cocoapods what config it should use, in other words map your condfigurations with pods configurations , otherwise your compile time might dramatically increase
What fixed it for me was:
Here is the include for the config file (SupportingFiles->Config->ConfigFiles)
#include "Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.release prod.xcconfig"
Links that helped me:
Great Tutorial on setting up configs with Cocoapods
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.