To set up user experience monitoring for your iOS apps, you can follow either the CocoaPods- or Carthage-based approach. Although not recommended, you can also follow the manual approach.
Independently of the approach followed, you have to add the generated application and environment IDs to your project’s
Info.plist file, so that your iOS mobile app can send monitoring data to your Dynatrace monitoring environment. Further details for each approach are provided below.
Set up OneAgent with CocoaPods
To set up OneAgent with CocoaPods:
Click Applications in the navigation menu.
Select your mobile application.
Click the browse button (...) in the top right corner and select Edit.
Click Instrumentation in the left menu.
Select Apple iOS.
Select the CocoaPods tab. 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.
You can set up Dynatrace as a dynamic framework by adding the pod
Dynatrace to your
Podfile. Be sure to uncomment the line
# 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
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
# 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 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.
For further information about Podfiles, please see the Podfile Syntax Reference.
CocoaPods automatically adds Dynatrace to your iOS project during the build process.
Set up OneAgent with Carthage
Dynatrace OneAgent can also be included via Carthage. Use this line to add it to your
Set up OneAgent manually
To set up OneAgent manually:
- Click Applications in the navigation menu.
- Select your mobile application.
- Click the browse button (...) in the top right corner and select Edit.
- Click Instrumentation in the left menu.
- Select Apple iOS.
- Select the Developer tab and follow the instructions provided on that page.