Skip To Content

Configure your Xcode project

In this topic

Setup your Xcode project manually

To use this SDK you need to add the API and other SDK resources to your Xcode project. This topic describes how you can configure your project to incoporate these files manually.


If you are new to the SDK or if you are starting a brand new project we recommend that you take advantage of a pre-configured project installed to ${HOME}/Library/SDKs/ArcGIS/OSX/Samples/MapViewDemo that will display a fully functioning map. Simply copy and rename this project.

If you want to use this API within your existing project or you want to explore how to set up a new project please follow the steps described below:

1. Add ArcGIS to the framework search paths

The ArcGIS.framework contains the API components required for this SDK. Add this framework to your Xcode project and then any dependent Apple frameworks as detailed in the next section.

  1. To add the ArcGIS framework to your project, select the project node in the left navigator pane, select a target node, and choose the Build Settings tab.
  2. 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 add the following entry: $(HOME)/Library/SDKs/ArcGIS/OSX/**. Framework search paths

2. Add build flags

You need to add build flags to your project to ensure that the ArcGIS framework is loaded correctly.

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

Without these flags, your application may crash while trying to use classes from the ArcGIS Runtime API.

3. Add dependencies

The ArcGIS framework in-turn depends upon a number of other 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.Enable Modules

Alternatively, you can manually add the following frameworks to your project's settings:

  • AppKit.framework
  • Cocoa.framework
  • CoreLocation.framework
  • Quartz.framework
  • QTKit.framework
  • OpenGL.framework
  • Security.framework

  1. Select the Build Phases tab.
  2. Under the Link Binary with Libraries section, click the + button, and select and add each dependency.Add dependent libraries

The library libc++.dylib is essential and must be added to your project, as shown above.

4. Add the resource bundle

API resources, such as images for the Esri and Bing logos, GPS location, and so on, are consolidated into an ArcGIS.bundle file. This bundle is typically installed under ${HOME}/Library/SDKs/ArcGIS/OSX/ArcGIS.framework/Versions/Current/Resources if you selected the default location during installation. Manually add this bundle to your project as described below.

  1. In Xcode, in the File menu, select the Add Files to <project> item.
  2. Browse to ${HOME}/Library/SDKs/ArcGIS/OSX/ArcGIS.framework/Versions/Current/Resources.
  3. Select the ArcGIS.bundle file and click Add.


The ${HOME}/Library folder is hidden by default in most OS X operating systems. You can issue the command chflags nohidden ~/Library/ in the Terminal application to show it. This enables you to browse to it using the Add Files to <project> window.

To use custom images instead of those provided with the bundle, add the custom images to your project, making sure they have the same name as the images in the bundle. Images in your project take precedence over those in the bundle.

5. Import header file

Add the following import statement to any swift file in which you wish to use the API -

import ArcGIS


It is necessary to add the import statement if you are using the Enable Modules approach described above, otherwise, your project may not compile properly. This happens because without the import statement, Xcode does not know which system libraries and frameworks ArcGIS depends upon and so cannot reference them at build time.

Set up your Xcode project using CocoaPods

If you're already using CocoaPods, setting up your project to use ArcGIS is really easy.

  1. Add pod 'ArcGIS-Runtime-SDK-OSX' 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.
  3. Open the project workspace (*.xcworkspace file) and add the import statement import ArcGIS to any swift file in which you wish to use the API

Learn how to get started with CocoaPods