Search code examples
swiftfirebasecocoapods

How to use downloaded Pods for multiple projects?


I have downloaded "Authentication & Cloud Firestore" pods. Can I use these pods for multiple projects and simply just install them for each one, without having to download pods all over again?


Solution

  • CocoaPods will have a copy of all locally installed pods in the mac storage (for all iOS projects)

    So that, when next time if you are installing the same pod for new project, it will not download from the internet, the copy which is already downloaded will be integrated with the project.

    I tried this now and it worked:

    Steps1: Created a new project ABC

    and in the terminal using the command pod init initialised the cocoapods into the project

    then ran pod install and opened the ABC.xcworkspace and in the Podfile added a library pod 'PullToRefresh'

    and moved to the terminal again and ran pod install

    now I can see the pod folder with the library contents.

    Step 2: Turned off the mac wifi internet

    Step 3: Created a new project ABC2,

    initialised the pod and added same pod 'PullToRefresh' into the podfile, now the cocoapods seamlessly installed the already downloaded library for a different project into my new project.

    Thus proves us cocoapods not downloading every time when the same is installed even for other projects