0
votes

I'm trying to add to my app both Moltin and Firebase pods. I know that if I want to open the file (with only one pod installed) I need to open it from the .xcworkspace file instead of using the .xcodeproj file.

Which file do I have to open if I have more than one pod installed (and so two .xcworkspace files)?

3

3 Answers

8
votes

After you install your first pod, you should always use .xcworkspace.

It doesn't matter how many pods you have installed, after the first one, always use .xcworkspace.

In other words:

0 pods, use .xcodeproj

1+ pods, use .xcworkspace


There will only be one .xcworkspace.

2
votes

You can install more than one pods in podFile , as Gustavo said , There will only be one Podfile in a project.Create it once and add pods into Podfile whatever you want like :

target 'AppName' do

frameworks
  use_frameworks!
  pod 'Firebase'
  pod 'Moltin'
  ... 
2
votes

Xcode workspace is a directory (not a file) which has a .xcworkspace extension. Finder shows it as a package. It actually is an Xcode document that groups projects and other documents so can be worked together in your project.

A workspace can contain any number of Xcode projects, plus any other files you want to include.

When you open an XCWORKSPACE, it opens the associated project and restores the perspective. Therefore, Xcode workspace files can be used as a wrapper or container for an Xcode .XCODEPROJ project.

Xcode workspace directory includes a vital XML file named contents.xcworkspacedata, and it looks like:

<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "group:MySampleProject.xcodeproj">
   </FileRef>
   <FileRef
      location = "group:OtherProject(for example Pods).xcodeproj">
   </FileRef>
</Workspace>

In this arbitrary tree, group: represents the directory of your project/s (as many you have). Additionally .xcworkspace always exists it may be external to an .xcodeproj, or embedded within one. Therefore, whenever you see .xcworkspace you have to use it to open your project.