Set Up with CocoaPods
Automatic deployment saves you the time of manually configuring your project, helping you build your application more efficiently. The automatic deployment setup process is described in detail in the Getting Started Guide. This page highlights important notes and considerations.
Install CocoaPods
Step 1: Upgrade Gem
An outdated gem version may cause installation or upgrade failures. Upgrade gem using the following command:
sudo gem update --systemStep 2: Install CocoaPods
Check your OS X version.
If your OS X version is 10.11 or earlier, run the following commands to install CocoaPods:
sudo gem install cocoapods
pod setupIf your OS X version is later than 10.11, run the following commands:
sudo gem install -n /usr/local/bin cocoapods
pod setupNote: The installation process may take a long time and can fail due to network conditions. You may need to try multiple times until it succeeds.
Install the SDK Using CocoaPods
Step 1: Create a Podfile
Create a file named Podfile in the same directory as your project's .xcodeproj file. If you haven't created an Xcode project yet, create one and save it to your local computer. The Podfile content is shown below (using the 3D Map SDK as an example; refer to the table below for other SDK pod names):
platform :ios, '7.0' # System version
target 'YourProjectTarget' do # Project name
pod 'AMap3DMap' # 3D Map SDK
end
AMAP iOS SDK Pod Names
Step 2: Configure and Install the SDK
Run the following commands to configure and install the SDK:
pod repo update # Ensures the local map-related SDK is up to date
pod installNote: The pod 'AMapLocation' command also imports the Foundation SDK, which may affect App Store submission. Click here to learn more about the Foundation SDK.
Step 3: Open the Project
After the command executes successfully, a .xcworkspace file is generated. Open the .xcworkspace file to launch your project (do not open the .xcodeproj file at the same time), as shown below.

Upgrade the SDK
If you have already installed the AMAP iOS Map SDK and want to update to the latest version, run the following commands in the directory containing your Podfile:
pod repo update # Ensures the local map-related SDK is up to date
pod updateNote: The pod update command also updates the Foundation SDK, which may affect App Store submission. Click here to learn more about the Foundation SDK.
Specify an SDK Version
To use a specific version of the SDK, modify your Podfile to include the version number. For example:
platform :ios, '7.0' # System version
target 'YourProjectTarget' do # Project name
pod 'AMap3DMap', '~>4.4.1' # Specify the version number here
endThen run the following command:
pod repo update # Ensures the local map-related SDK is up to date
pod install