When the number of pods in your project increases, and it take forever to complete a fresh build, Carthage seems a better choice more and more. But you have dozens of pods, it's hard or impossible (React Native) to migrate all the pods to Carthage at once. So is it possible to use both Carthage and CocoaPods at the same time and migrate every pod one by one? Recently I figured out a way to do this.
Create Cartfile in the root directory of your project, add the pods you want to migrate, for example:
github "onevcat/Kingfisher" ~> 4.0
carthage update to fetch dependencies and build frameworks.
vendored_frameworks to reference frameworks generated by
Pod::Spec.new do |s| s.name = 'Carthage' s.version = '0.1.0' s.summary = 'Load Carthage frameworks' s.ios.deployment_target = '9.0' s.swift_version = '4.1' s.vendored_frameworks = 'Carthage/Build/iOS/*.framework' end
CarthageFrameworks to your Podfile and comment out
pod 'Carthage', :path => 'Carthage.podspec' # pod 'Kingfisher' pod `AnotherPod`
pod install to load
AnotherPod also depends on
Kingfisher, now it needs to depend on