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
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
Use Dynatrace as a static library
You can set up Dynatrace as static library by adding the pod
Dynatrace/lib to your
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 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
Dynatrace Framework can also be included via Carthage. Use this line to add it to your Carthfile:
- 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.