Install and set up

Follow this guide to install the SDK on your Mac. You can either

  • use CocoaPods to install the SDK into your Xcode workspace
  • or install the SDK to a central location on your Mac and link your Xcode projects to that SDK.
Both methods are described here:

Install the SDK using CocoaPods

The ArcGIS Runtime SDK for iOS is available for you as a registered CocoaPod. If you are new to Cocoapods then learn how to get started with CocoaPods here and then follow these instructions to use this pod within your project :

  1. Add pod 'ArcGIS-Runtime-SDK-iOS', '100.2' to your project's Podfile
  2. Run the command pod install on the Podfile using the Terminal application. This will download the ArcGIS framework to your machine and place it inside your project's Pod directory. It will also make the necessary changes to your project's build settings to correctly reference the ArcGIS framework and create a new Xcode workspace (.xcworkspace file).

That's it. To use the ArcGIS API, open the newly created Xcode workspace and add the following import statement to any of your swift code (.swift) files:

import ArcGIS

Install the SDK manually

Alternatively, you can install the SDK on your Mac in a location available to all of your projects:

  1. Make sure your system meets the system requirements.
  2. Download the SDK from the Downloads page
  3. Make sure you have write permissions to the ${HOME}/Library folder.
  4. If you have installed a previous version of ArcGIS Runtime SDK for iOS on this machine, uninstall it. Otherwise, the previous installation will be overwritten. To uninstall, run the ${HOME}/Library/Application Support/AGSiOSRuntimeSDK/uninstallAGSiOSSDK script in the Terminal application.
  5. Download the SDK. After you've downloaded the SDK, double-click the downloaded .pkg file. In the installation wizard that displays, follow the on-screen instructions to step through the panels.
  6. By default the SDK is installed into ${HOME}/Library/SDKs/ArcGIS/iOS. This folder contains two subfolders - Frameworks and Samples. Go to the Samples folder and run either the Objective-C or Swift sample to ensure that everything was installed correctly on your machine.
Note:

The ${HOME}/Library folder is hidden by default. Unhide it using the command chflags nohidden ~/Library/ in the Terminal application.

If you encounter installation errors, see the install.log file at /var/log/install.log for more information. A common reason for failure is the installation package getting corrupted during download. Try downloading the package again. On rare occasions, the installer may ask you for your username/password during installation. When this happens, the installer finishes successfully but the SDK gets installed in the root directory instead of in your home directory. To resolve this issue, you can manually copy the SDKs folder from the root /Library directory into your user profile's $HOME/Library directory.

Configure your Xcode project

After manually installing the SDK you must configure each Xcode project so that it can use the API.

  1. Add ArcGIS to the framework search paths
  2. Add build flags
  3. Link dependencies
  4. Add ArcGIS resource bundle

Add ArcGIS to the framework search paths

Select the project node in the left Navigator pane, select a target node, and choose the Build Settings tab. Under the tab, type Framework Search Paths in the Search bar to quickly find the Framework Search Paths setting. Double-click the empty space under the target column, and use the + button to type the following text: $(HOME)/Library/SDKs/ArcGIS/iOS/Frameworks/Static. Click anywhere outside the text box to finish.

Add build flags

Under the Build Settings tab, type Other Linker Flags in the Search bar to quickly find the Other Linker Flags setting. Click the empty space under the target column. The empty space becomes a text box. Type the following text: -ObjC -framework ArcGIS -l c++. Click anywhere outside the text box to finish.

Link dependencies

The ArcGIS framework in-turn depends upon a number of other iOS frameworks. The easiest way to ensure these dependencies are linked in during build time is set the Enable Modules (C and Objective-C) setting to Yes. This will allow your project to automatically reference any needed system frameworks and libraries required by ArcGIS.

Add ArcGIS resource bundle

The SDK resources, such as the ESRI and Bing logo images, GPS location symbol, localized strings, etc. are contained in a single ArcGIS.bundle file. If you selected the default installation location then this bundle will be located in $(HOME)/Library/SDKs/ArcGIS/iOS/Frameworks/Static/ArcGIS.framework/Versions/Current/Resources. You can add this ArcGIS resource bundle to your project as follows:

  1. Go to the Xcode application File menu and select the Add Files to <project> item.
  2. Browse to the ${HOME}/Library/SDKs/ArcGIS/iOS/Frameworks/Static/ArcGIS.framework/Versions/Current/Resources location.
  3. Select the ArcGIS.bundle file and click Add.

That's it. To use the ArcGIS API, simply add the following import statement to any of your swift code (.swift) files:

import ArcGIS

Related topics