# CocoaPods Best Practices (1.7 and below)

**URL:** <https://discuss.circleci.com/t/cocoapods-best-practices-1-7-and-below/33477>\
**Category:** Mobile\
**Created:** [November 21, 2019, 12:03pm UTC](https://discuss.circleci.com/t/cocoapods-best-practices-1-7-and-below/33477 "2019-11-21T12:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bytesguy](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bytesguy](https://discuss.circleci.com/u/bytesguy)\
**Post date:** [November 21, 2019, 12:03pm UTC](https://discuss.circleci.com/t/cocoapods-best-practices-1-7-and-below/33477/1 "2019-11-21T12:03:46Z")

</div>

## **NOTE** This guide is superseded by the [documentation here](https://circleci.com/docs/2.0/testing-ios/#best-practices)

We now recommend using CocoaPods 1.8 due to the new CocoaPods CDN that significantly speeds up Pod installs.

The guide below is archived and only applicable for projects using CocoaPods 1.7 and below with the Podspec repo.

* * *

It is best practice to include downloading CocoaPods specs from the CircleCI mirror (up to 70% faster) and linting the Swift code together with the `build-and-test` job:

```yaml
# .circleci/config.yml
version: 2
jobs:
  build-and-test:
    macos:
      xcode: "10.2.0"
    environment:
      FL_OUTPUT_DIR: output
    steps:
      - checkout
      - run:
          name: Fetch CocoaPods Specs
          command: |
            curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
      - run:
          name: Install CocoaPods
          command: pod install --verbose

      - run:
          name: Build and run tests
          command: fastlane scan
          environment:
            SCAN_DEVICE: iPhone 8
            SCAN_SCHEME: WebTests

      - store_test_results:
          path: output/scan
      - store_artifacts:
          path: output

workflows:
  version: 2
  build-and-test:
    jobs:
      - build-and-test

```

---

<div class="post-metadata">

**Author:** ![bytesguy](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bytesguy](https://discuss.circleci.com/u/bytesguy)\
**Post date:** [November 21, 2019, 12:03pm UTC](https://discuss.circleci.com/t/cocoapods-best-practices-1-7-and-below/33477/2 "2019-11-21T12:03:53Z")

</div>

Closed on November 21, 2019, 12:03pm UTC


