How to add cocoapods to existing workspace not project

北城余情 提交于 2019-11-30 13:13:18

问题


I am working on a project which is composed of three other projects in a workspace. I want to use CocoaPods to manage my dependecies in the workspace, but CocoaPods always creates its own workspace with only one addtional project. What I want to do is to add CocoaPods project to the workspace that already exists. Is there any simple way to achive that?


回答1:


You can specify a workspace in your podfile.

workspace 'MyWorkspace'

Please consult this link for more info: http://guides.cocoapods.org/syntax/podfile.html#workspace




回答2:


In terminal go to directory with your xcworkspace-file.

$ touch Podfile

then in Podfile :

workspace 'YourWorkspace'

target 'YourProjectName' do
    platform :ios, '8.0'
    pod 'your pod' 
    project 'Path to your Project in your workspace'
end

$ pod install



来源:https://stackoverflow.com/questions/22295833/how-to-add-cocoapods-to-existing-workspace-not-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!