Get started with iOS monitoring

Before instrumenting OneAgent, create a mobile app in your monitoring environment through which you will be able to monitor your actual mobile app:

  1. From the navigation menu, select Deploy Dynatrace.
  2. Select Set up mobile monitoring and type the name of your mobile app.
  3. Select Create mobile app.

Privacy

To see detailed information about the data that OneAgent for iOS monitors and a guide to fill out the App Store Connect questionnaire, see User privacy for iOS.

Next steps

Subsequently, you can instrument your app via the CocoaPods, Swift Package Manager, or Carthage-based approach. For advanced auto-instrumentation, use the configuration keys.

When you use Dynatrace.framework or the static libDynatrace.a library to instrument your iOS app, you need to perform some additional steps:

Additional steps for framework

Perform these additional steps if you use Dynatrace.framework:

Remove iOS Simulator architecture of the release binary

  1. In Xcode, add a Run Script Phase as the last Build Phase of your Application Target.
  2. Select Run script only when installing.

This removes the iOS Simulator architecture from your release binary used for AppStore Connect upload.

Xcode 12 build fails with architecture mismatch errors

If the build fails with architecture mismatch errors, turn on workspace validation.

  1. In Xcode, go to Build Settings.
  2. For Validate Workspace, select Yes.

Additional steps for library

Perform these additional steps if you use the libDynatrace.a library:

Add linker flag

  1. In Xcode, go to the Build Settings section of your Application Target.
  2. Expand Linking.
  3. Add the -ObjC flag to Other Linker Flags.

Make Dynatrace available to Swift code

You can skip this step if your application does not have Swift code or it doesn't need access to the Dynatrace library.

  1. We asssume you already created Objective-C bridging header file for your Swift code in Xcode.
  2. Make sure you set the bridging header file in your Application Target build settings.
  3. Add the following import line to the bridging header file:
    `#import "Dynatrace.h"`