How to use the same pods to two targets

I'm new in Swift 3, I need a help to edit the code and run the Dev target that not mentioned in PodFile but is a target that import the pods from the production target.

My question is: How to do it correctly?

$ pod env

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.13.6 (17G65)
       Xcode : 8.3 (8E162)
         Git : git version 2.18.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ c90001fac54381e04d0cdcb8a50fe65792ccbbf8

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-clean       : 0.0.1
cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '9.3'
# Uncomment this line if you're using Swift
use_frameworks!

target 'my-Project' do

	pod 'Alamofire', '~> 4.0'
	pod 'MBProgressHUD'
	pod 'PromiseKit', '~> 4.0'
	pod 'MBAutoGrowingTextView', '~> 0.1.0'
	pod 'PusherSwift', '~> 3.0'
	pod 'PopupDialog', '~> 0.4'
	pod 'SwiftMessages', '3.5.1'
	pod 'Bugsnag'
	pod 'AutoCompleteTextField'

	pod 'Fabric'
	pod 'Crashlytics'

	target 'my-ProjectTests' do
		inherit! :search_paths
	end
end

post_install do |installer|
	installer.pods_project.targets.each do |target|
		target.build_configurations.each do |config|
			config.build_settings['SWIFT_VERSION'] = '3.0'
		end
	end
end

EDIT

I think the script in build phrases don't run.

I don't know where Xcode generate this script file because 'Pods' directory isn't versioned on git.

Your question is more about CocoaPods than about Swift itself. My recommendation is that you follow-up via whatever support resources recommended by the CocoaPod folks (it looks like here is a good place to start).

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

1 Like