Xcode Unit Testing with Cocoapods Xcode Unit Testing with Cocoapods xcode xcode

Xcode Unit Testing with Cocoapods


I had the same issue. I solved it by moving pod 'Firebase' to my test target. Change your Podfile to this:

platform :ios, '9.0'use_frameworks!inhibit_all_warnings!target 'MyApp' do    pod 'Firebase/Auth'    pod 'Firebase/Database'    pod 'Firebase/Storage'    target 'MyAppTests' do        inherit! :search_paths        pod 'Firebase'    endend


Try changing the inheritance to :complete, as in:

target 'MyAppTests' do    inherit! :completeend

Importantly it allows anyone else checking out your repo to just do a pod update as usual without having to copy .xcconfig files or other hackery just to build.


  1. Select your Unit Test Target setting.
  2. Go to Build Settings.
  3. Look for Header Search Paths.
  4. Add this value $(SRCROOT)/Pods with recursive, then Xcode will resolve the path for you.

Example