SDK Setup Options

The AWS SDK contains high level client interfaces for quickly adding common features and functionality to your app. You can also manually add the generated AWS service interfaces for direct interaction if you have custom or advanced requirements.

CocoaPods setup

The AWS Mobile SDK for iOS is available through CocoaPods. Install CocoaPods by running the following commands from the folder containing your projects *.xcodeproj file:

1gem install cocoapods
2pod setup
3pod init

In your project directory (the directory where your *.xcodeproj file is), open the empty text file named Podfile. Replace myAppName with your app name. You can also remove pods for services that you don't use. For example, if you don't use AWSAutoScaling, remove or do not include the AWSAutoScaling pod.

1source ''
3platform :ios, '9.0'
6target :'YOUR-APP-NAME' do
7 pod 'AWSAuth'
8 pod 'AWSAuthCore'
9 pod 'AWSAuthUI'
10 pod 'AWSAutoScaling'
11 pod 'AWSCloudWatch'
12 pod 'AWSCognito'
13 pod 'AWSCognitoAuth'
14 pod 'AWSCognitoIdentityProvider'
15 pod 'AWSCognitoIdentityProviderASF'
16 pod 'AWSCore'
17 pod 'AWSDynamoDB'
18 pod 'AWSEC2'
19 pod 'AWSElasticLoadBalancing'
20 pod 'AWSFacebookSignIn'
21 pod 'AWSGoogleSignIn'
22 pod 'AWSIoT'
23 pod 'AWSKMS'
24 pod 'AWSKinesis'
25 pod 'AWSLambda'
26 pod 'AWSLex'
27 pod 'AWSLogs'
28 pod 'AWSMachineLearning'
29 pod 'AWSMobileClient'
30 pod 'AWSPinpoint'
31 pod 'AWSPolly'
32 pod 'AWSRekognition'
33 pod 'AWSS3'
34 pod 'AWSSES'
35 pod 'AWSSNS'
36 pod 'AWSSQS'
37 pod 'AWSSimpleDB'
38 pod 'AWSUserPoolsSignIn'

Once complete, run pod install and open the *.xcworkspace with Xcode and build your project to start using the SDK. Once you have created a workspace, always use *.xcworkspace to open the project instead of *.xcodeproj.

Whenever a new version of the SDK is released you can update by running pod update and rebuilding your project to use the new features.

Carthage setup

The AWS Mobile SDK for iOS is available through Carthage. Install the latest version of Carthage.

Add the following to your Cartfile:

1github "aws-amplify/aws-sdk-ios"

Once complete, run carthage update and open the *.xcworkspace or *.xcodeproj file with Xcode and chose your Target. In the General tab, find Embedded Binaries, then choose the + button.

Choose the Add Other button, navigate to the AWS<#ServiceName#>.framework files under Carthage > Build > iOS and select AWSCore.framework and the other service frameworks you require. Do not select the Destination: Copy items if needed check box when prompted.

  • AWSAuth
  • AWSAuthCore
  • AWSAuthUI
  • AWSAutoScaling
  • AWSCloudWatch
  • AWSCognito
  • AWSCognitoAuth
  • AWSCognitoIdentityProvider
  • AWSCognitoIdentityProviderASF
  • AWSCore
  • AWSDynamoDB
  • AWSEC2
  • AWSElasticLoadBalancing
  • AWSFacebookSignIn
  • AWSGoogleSignIn
  • AWSIoT
  • AWSKinesis
  • AWSLambda
  • AWSLex
  • AWSLogs
  • AWSMachineLearning
  • AWSMobileClient
  • AWSPinpoint
  • AWSPolly
  • AWSRekognition
  • AWSS3
  • AWSSimpleDB
  • AWSUserPoolsSignIn

Under the Build Phases tab in your Target, choose the + button on the top left and then select New Run Script Phase.

Setup the build phase as follows. Make sure this phase is below the Embed Frameworks phase.

1Shell /bin/sh
5Show environment variables in build log: Checked
6Run script only when installing: Not checked
8Input Files: Empty
9Output Files: Empty

Now build your project to start using the SDK. Whenever a new version of the SDK is released you can update by running carthage update and rebuilding your project to use the new features.

Note: The AWS SDK for iOS builds the Carthage binaries using the latest released version of Xcode. To consume the pre-built binaries your Xcode version needs to be the same, else you have to build the frameworks on your machine by passing --no-use-binaries flag to carthage update command.

Frameworks setup

Download the latest SDK. Older SDK versions can be downloaded from, where #.#.# represents the version number. So for version 2.10.2, the download link is

With your project open in Xcode, select your Target. Under General tab, find Embedded Binaries and then click the + button.

Click the Add Other... button, navigate to the AWS<#ServiceName#>.framework files and select them. Check the Destination: Copy items if needed checkbox when prompted.

  • AWSAuth.framework
  • AWSAuthCore.framework
  • AWSAuthUI.framework
  • AWSAutoScaling.framework
  • AWSCloudWatch.framework
  • AWSCognito.framework
  • AWSCognitoAuth.framework
  • AWSCognitoIdentityProvider.framework
  • AWSCognitoIdentityProviderASF.framework
  • AWSCore.framework
  • AWSDynamoDB.framework
  • AWSEC2.framework
  • AWSElasticLoadBalancing.framework
  • AWSFacebookSignIn.framework
  • AWSGoogleSignIn.framework
  • AWSIoT.framework
  • AWSKMS.framework
  • AWSKinesis.framework
  • AWSLambda.framework
  • AWSLex.framework
  • AWSLogs.framework
  • AWSMachineLearning.framework
  • AWSMobileClient.framework
  • AWSPinpoint.framework
  • AWSPolly.framework
  • AWSRekognition.framework
  • AWSS3.framework
  • AWSSES.framework
  • AWSSNS.framework
  • AWSSQS.framework
  • AWSSimpleDB.framework
  • AWSUserPoolsSignIn.framework

Under the Build Phases tab in your Target, click the + button on the top left and then select New Run Script Phase. Then setup the build phase as follows. Make sure this phase is below the Embed Frameworks phase.

Shell /bin/sh


Show environment variables in build log: Checked Run script only when installing: Not checked

Input Files: Empty Output Files: Empty

Now build your project to start using the SDK. Whenever a new version of the SDK is released you can update by selecting the previously imported AWS frameworks in Project Navigator in Xcode and pressing 'delete' on your keyboard. Then select Move to Trash and follow the installation process above to include the new version of the SDK.

AWS SDK Version vs. Semantic Versioning

The AWS SDK for iOS does not follow semantic versioning. Instead, it increments the patch-level version for both backward-compatible bug fixes and non-breaking changes, and increments the minor version for breaking changes. Major version changes are rare, and usually indicate a dramatically different programming model.

For comparison, Semantic versioning increments the patch level for backward-compatible bug fixes, the minor version for backward-compatible new features, and the major version for breaking changes.

Direct AWS Service access

You can call AWS service interface objects directly via the generated SDK clients. You can use the client credentials provided by the AWSMobileClient when using the .default() method on a service object (e.g. AWSSQS.default()). This will leverage short term AWS credentials from Cognito Identity. Alternatively, you can call the constructors manually.

Note: If you are relying on the AWSMobileClient as the credentials provider, then initialize the AWSMobileClient before constructing any other service client. The AWSMobileClient will attach itself as the credentials provider for all default clients. However, if you attach a default credentials provider before initializing the AWSMobileClient, then you cannot rely on the AWSMobileClient to vend credentials used to authenticate the service client's API calls.

To work with service interface objects, your Amazon Cognito users' IAM role must have the appropriate permissions to call the requested services.

For example, if you were using Amazon Simple Queue Service (SQS) in Swift you would first add AWSSQS to your Podfile and install the dependencies with pod install (alternatively follow the instructions for Carthage or Frameworks). Next, update your awsconfiguration.json like so:

1"SQS" : {
2 "Default": {
3 "Region": "XX-XXXX-X"
4 }

Note: The key is SQS and not AWSSQS as the awsconfiguration.json file does not prefix keys with AWS.

Next, import AWSSQS in your Xcode project and create the client:

1import AWSSQS
3func addItemSQS() {
4 let sqs = AWSSQS.default()
5 let req = AWSSQSSendMessageRequest()
6 req?.queueUrl = ""
7 req?.messageBody = "hello world"
8 sqs.sendMessage(req!) { (result, err) in
9 if let result = result {
10 print("SQS result: \(result)")
11 }
12 if let err = err {
13 print("SQS error: \(err)")
14 }
15 }

You could then call self.addItemSQS() to invoke this action from your app.


As of version 2.5.4 of this SDK, logging utilizes CocoaLumberjack SDK, a flexible, fast, open source logging framework. It supports many capabilities including the ability to set logging level per output target, for instance, concise messages logged to the console and verbose messages to a log file.

CocoaLumberjack logging levels are additive such that when the level is set to verbose, all messages from the levels below verbose are logged. It is also possible to set custom logging to meet your needs. For more information, see CocoaLumberjack Logging Levels.

You can change the logging level to suit the phase of your development cycle by importing AWSCore and calling:

1AWSDDLog.sharedInstance.logLevel = .verbose

The following logging level options are available:

  • .off
  • .error
  • .warning
  • .info
  • .debug
  • .verbose

We recommend setting the log level to .off before publishing to the App Store.

CocoaLumberjack can direct logs to file or used as a framework that integrates with the Xcode console. For example:

1//File Logger example
2let fileLogger: AWSDDFileLogger = AWSDDFileLogger() // File Logger
3fileLogger.rollingFrequency = TimeInterval(60*60*24) // 24 hours
4fileLogger.logFileManager.maximumNumberOfLogFiles = 7
7//Console example
8AWSDDLog.add(AWSDDTTYLogger.sharedInstance) // TTY = Xcode console

Configure using an in-memory object

As an alternative to the awsconfiguration.json file, since version 2.11.0 a configuration object can also be used for configuring the client. This approach can be useful for resolving configuration in runtime instead of the pre-defined JSON file:

1let configuration: [String: Any] = [
2 "IdentityManager": [
3 "Default": [:]
4 ],
5 "Auth": [
6 "Default": [
7 "OAuth": [
8 "AppClientId": "APP_CLIENT_ID",
9 "Scopes": ["email"]
10 ]
11 ]
12 ]
15let mobileClient = AWSMobileClient(configuration: configuration)
16mobileClient.initialize { (userState, error) in
17 // initialization logic

Please note that creating multiple instances of AWSMobileClient is not supported. The configuration cannot be reset and/or re-initialized. Therefore, even though you can instantiate AWSMobileClient multiple times, all instances will have the same configuration reference. If you configure AWSMobileClient as shown above, make sure to use the initialized in memory object of mobileClient instead of the singleton object of AWSMobileClient.