Install a Google SDK using CocoaPods

Google distributes several iOS specific APIs and SDKs via CocoaPods. CocoaPods is an open source dependency manager for Swift and Objective-C Cocoa projects. CocoaPods makes it easy to install or update new SDKs when working with Xcode.

You can install the CocoaPods tool on OS X by running the following command from the terminal. Detailed information is available in the Getting Started guide.

$ sudo gem install cocoapods

Add a Google SDK to your iOS app

CocoaPods is used to install and manage dependencies in existing Xcode projects.

  1. Create an Xcode project, and save it to your local machine.
  2. Create a file named Podfile in your project directory. This file defines your project's dependencies, and is commonly referred to as a Podspec.
  3. Open Podfile, and add your dependencies. A simple Podspec is shown here:

    platform :ios, '8.1'
    target "YourProjectNameHere" do
      pod 'Firebase'
    end 

  4. Save the file.

  5. Open a terminal and cd to the directory containing the Podfile.

    $ cd <path-to-project>/project/
    
  6. Run the pod install command. This will install the SDKs specified in the Podspec, along with any dependencies they may have.

    $ pod update
    
  7. Open your app's .xcworkspace file to launch Xcode. Use this file for all development on your app.

CocoaPods published by Google

Below is a complete list of the Podspecs published by Google.

CocoaPods published by Google
App Invites AppInvites
Google Analytics GoogleAnalytics
Google App Indexing GoogleAppIndexing
Google Cloud Messaging GoogleCloudMessaging
Google Conversion Tracking GoogleConversionTracking
Google Maps GoogleMaps
Google Mobile Ads GoogleMobileAds
Google IDFA Support GoogleIDFASupport
Google Places GooglePlaces
Google Sign In GoogleSignIn
Google Tag Manager GoogleTagManager
Instance ID GGLInstanceID
Google Cast google-cast-sdk
Firebase Firebase
Google Play Games Services GooglePlayGames
GeoFire GeoFire
Google Interactive Media Ads GoogleAds-IMA-iOS-SDK
Nearby Messages NearbyMessages

FAQ

I'm using CocoaPods. How do I update to the latest version of the SDK?
In the terminal, run pod update in the directory where the Podfile is located.
What can I do if the pod command isn't working?
CocoaPods may not be installed on your system. Please follow the Getting Started guide and try again. If that doesn't resolve the issue, check the status of the CocoaPods service at: https://status.cocoapods.org/.