I have read about a possibility to add CocoaPods to an XcodeProject without getting the xcworkspace file, instead you get a xcodeproj file that you can integrate into your current project. How can I do that? Would love to use the xcodeproj file instead of xcworkspace.. I'm programming in swift (if that makes any difference).
-
What's the problem with using the workspace...? – nhgrif Mar 10 '16 at 00:00
-
1there is not really a problem, I just heard that it's possible and wanted to know how... Let's say for esthetic reasons :D – beginner_T Mar 10 '16 at 00:12
-
1Where did you hear that? Stack Overflow is not a place for checking out rumors. This doesn't appear to even remotely be a real problem. – nhgrif Mar 10 '16 at 00:16
-
I think the question definitely has its merrits. Leave the rumor part out and you have a perfectly viable question. – JustSid Mar 10 '16 at 00:17
-
So if you read your question, _get a xcodeproj file that you can integrate into your current project_, this means you'll eventually get a xcworkspace file (otherwise how can you integrate?) And yes, cocoa pods will actually generate a xcodeproj file for its own project called `Pods` by default. – J.Wang Mar 10 '16 at 00:22
-
I read this on stack overflow :D but they were talking about a different topic, so I didn't want to interrupt with that question, just made me wonder how that works – beginner_T Mar 10 '16 at 01:37
-
@nhgrif my team briefly entertained the idea of placing several related (sharing most of their code) apps in the same workspace and building them with separate targets, but this proved impossible because each app has its own Podfile and thus must generate its own workspace – aednichols Mar 15 '16 at 22:36
-
@aednichols Well the obvious solution here is that the shared code should be in its own repository set up as a private pod. – nhgrif Mar 16 '16 at 03:02
3 Answers
Yes, its possible. But, we need to do few steps to proceed.
Check this Github thread.
The below line in
pod.file
will not let theclient integration
process.install! 'cocoapods', :integrate_targets => false
We can drag and drop the
Pods.xcodeproj
to the main projectLink the
target dependencies
andLink Binary with Libraries
in Build phases.
Thats it.

- 1
- 1

- 5,271
- 5
- 34
- 62
You can not do this.
The CocoaPods website guide to using CocoaPods found here directs you to using the .xcworkspace it creates. Several other guides found across the Internet all direct you to use this file indicating that using the .xcodeproj file will now result in build errors.
There is simply no evidence that this is a possibility at all.
From the CocoaPods website guide on using CocoaPods:
- Save your Podfile.
- Run $ pod install
- Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.
More from their website:
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project file when building your project:
$ open App.xcworkspace
And from the Ray Wenderlich guide regarding using CocoaPods with Swift:
Open the project folder using Finder, and you’ll see that CocoaPods created a new IceCreamShop.xcworkspace file and a Pods folder in which to store all the project’s dependencies.
And from an NSHipster article on CocoaPods:
CocoaPods will create a new Xcode project that creates static library targets for each dependency, and then links them all together into a libPods.a target. This static library becomes a dependency for your original application target. An xcworkspace file is created, and should be used from that point onward. This allows the original xcodeproj file to remain unchanged.

- 61,578
- 25
- 134
- 173
In older versions of cocoapods it was possible to install and update pods with the option '--no-integrate'. It allows you to create a library project, which could be imported into an existing project (read more). But this option is missing now. I've build a Xcode project for a maven-build with this option earlier. Today I've updated the pods of this project with the newest cocoapods version (1.0.0) but without the '--no-integrate' option and it still works. So eventually there is a way...

- 441
- 4
- 19