How do I enable user experience monitoring for iOS apps?

To begin instrumenting your iOS apps to receive user experience monitoring data, follow the Apple iOS instrumentation instructions below. It’s recommended that you follow the CocoaPods instrumentation instructions explained below as they are easier to follow than the manual instrumentation process, which is also offered below as an alternative.

Insert Dynatrace as a library dependency within the CocoaPods podfile specification. This can be done by either using Dynatrace as a dynamic framework or as a static library.

Use Dynatrace as a framework

You can set up Dynatrace as a dynamic framework by adding the pod Dynatrace to your Podfile. Be sure to uncomment the line #use_frameworks!

Example:

  # Uncomment this line to define a global platform for your project
  # platform :ios, '9.0'
  target 'DemoApp' do
    # Uncomment this line if you're using Swift or want to use dynamic frameworks
    use_frameworks!
    # Pods for DemoApp
    pod 'Dynatrace'
  end

Use Dynatrace as a static library

You can set up Dynatrace as static library by adding the pod Dynatrace/lib to your Podfile. If you use Dynatrace as static library, be sure to comment out the line use_frameworks!

Example:

  # Uncomment this line to define a global platform for your project
  # platform :ios, '7.0'
  target 'DemoApp' do
    # Uncomment this line if you're using Swift or want to use dynamic frameworks
    # use_frameworks!
    # Pods for DemoApp
    pod 'Dynatrace/lib'
  end

For further information about Podfiles, please see the Podfile Syntax Reference.

CocoaPods automatically adds Dynatrace to your iOS project during the build process.

To instruct your iOS mobile app to send monitoring data to the correct Dynatrace application, add the generated application and environment IDs to your project’s Info.plist file.

Carthage Support

Dynatrace Framework can also be included via Carthage. Use this line to add it to your Carthfile:

binary "https://files.dynatrace.com/mobileagent/carthage/dynatrace.json"

Notes

  • For iOS 8+ apps, use the framework.
  • For iOS 6+ apps, use the static library.
  • If you’re using Hockeyapp with Dynatrace, you’ll need to include Dynatrace as a framework to avoid symbol clashes. See the framework example above.