With the iOS 14 release (supported by iOS Agent 20.10.0), Apple introduced a new data collection policy. See iOS Data Collection Disclosure for details.


You can install the iOS SDK using CocoaPods or by manually downloading and installing it. We recommended that you use CocoaPods to install the iOS SDK because it handles the dependencies, the build settings, and simplifies upgrading.

Follow the instructions for your preferred installation method:

iOS SDK Install Requirements 

To install the iOS SDK, you must be running Xcode >= 7.

CocoaPods Install

  1. Add the line below to a target block in your Podfile:

    pod 'AppDynamicsAgent'

    For example:

    platform :ios, '8.0'
    use_frameworks!
    
    target 'YourApp' do
      pod 'AppDynamicsAgent'
    end
    TEXT
  2. In your project directory, run this command:

    pod install

Manual Install

To manually install the iOS SDK, follow these steps:

Download the iOS SDK

  1. Navigate to the AppDynamics Download page.

  2. From the APP AGENT list, check the Mobile RUM Agent - iOS checkbox.
  3. Click Download for the latest iOS Agent that will appear in the Releases results. This downloads a file named iOSAgent-<version>.zip

Add the Framework to the App

You can only use a Swift framework if that framework was built with the exact same version of Swift as the Xcode compiling your app.

  1. Unzip iOSAgent-<version>.zip.
  2. Import the ADEUMInstrumentation.framework (or ADEUMInstrumentation.xcframework) folder into your project Xcode.

If you don't see that Xcode has automatically added the correct path(s), add a project-relative path to your frameworks.


Add Required Libraries

The AppDynamics iOS Agent requires these libraries:

  • SystemConfiguration.framework
  • CoreTelephony.framework
  • libz.dylib or .tbd

To add the libraries:

  1. Select the target that builds your app in Xcode.
  2. Select the Build Phases tab.
  3. Expand the Link Binary With Libraries section.
  4. If any of the above libraries are not listed:
    • Click the + button.
    • Locate the missing library in the list.
    • Click Add

Repeat this step for each missing library.

Set the -ObjC Flag

You also need to add the -ObjC flag to Other Linker Flags.  

  1. Select your project in the Project Navigator.
  2. In the target list, select the target that builds your application.
  3. Select the Build Settings tab.
  4. Scroll to Linking and open.
  5. Go to Other Linker Flags and double-click to open the popup. 
  6. If the -ObjC flag is not in your list, click + and add it.  

The -ObjC flag is necessary because the iOS Agent defines categories with methods that can be called at runtime, and by default, these methods are not loaded by the linker. As a result, you'll get an "unrecognized selector" runtime exception. The use of -ObjC ensures the methods will be loaded.

Upgrade the iOS SDK

Upgrade with CocoaPods

  1. In your project directory, run this command: $ pod update

  2. Rebuild.

Upgrade Manually

To pick up new features or to get crucial bug fixes you want to upgrade the iOS SDK in your app.

  1. Download the updated SDK.
  2. Replace the .framework file using the updated SDK.
  3. Rebuild your app.