Install the iOS SDK

Note: 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.

The Splunk AppDynamics iOS SDK framework helps you to monitor the performance and activities of an iOS application. You can add the Splunk AppDynamics iOS SDK in your Xcode environment from the Splunk AppDynamics GitHub repository.

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

Note:
  • Swift Package Manager install is supported for iOS Agent 23.10.1 or higher.
  • Download the list of copyrights and licenses for each Open Source components in iOS Agent.

Follow the instructions for your preferred installation method:

iOS SDK Install Requirements

You must have the supported Xcode version.

Installation Type Xcode Version
CocoaPods and Manual >=7
Swift Package Manager >=14.1

CocoaPods のインストール

  1. 次の行を Podfile の ブロックに追加します。
    pod 'AppDynamicsAgent'

    例:

    CODE
    platform :ios, '8.0'
    use_frameworks!
    
    target 'YourApp' do
      pod 'AppDynamicsAgent'
    end
  2. プロジェクトディレクトリで、次のコマンドを実行します。
    pod install

iOS SDK のダウンロード

  1. ダウンロードページに移動します。
  2. [APP AGENT] リストから、[Mobile RUM Agent - iOS] チェックボックスをオンにします。
  3. [Releases] の結果に表示される最新の iOS エージェントの [Download] をクリックします。これにより、「iOSAgent-<version>.zip」という名前のファイルがダウンロードされます。

アプリケーションへのフレームワークの追加

注意: Swift フレームワークは、アプリケーションをコンパイルする Xcode とまったく同じバージョンの Swift で構築されている場合にのみ使用できます。
  1. iOSAgent-<version>.zip を解凍します。
  2. ADEUMInstrumentation.framework(または ADEUMInstrumentation.xcframework)フォルダをプロジェクト Xcode にインポートします。
注: Xcode が自動的に正しいパスを追加したことを確認できない場合は、フレームワークへのプロジェクト相対パスを追加します。

必要なライブラリの追加

Splunk AppDynamics iOS エージェントには、次のライブラリが必要です。
  • SystemConfiguration.framework
  • CoreTelephony.framework
  • libz.dylib または .tbd
  1. Xcode でアプリケーションを構築するターゲットを選択します。
  2. [Build Phases] タブを選択します。
  3. [Link Binary With Libraries] セクションを展開します。
  4. 上記のライブラリのいずれかが表示されない場合は、次の手順を実行します。
    • [+] ボタンをクリックします。
    • リスト内で欠落しているライブラリを特定します。
    • [Add] をクリックします。
欠落しているライブラリごとにこの手順を繰り返します。

-ObjC フラグの設定

また、[Other Linker Flags] にも -ObjC フラグを追加する必要があります。
  1. [Project Navigator] でプロジェクトを選択します。
  2. ターゲットリストで、アプリケーションを構築するターゲットを選択します。
  3. [Build Settings] タブを選択します。
  4. [] にスクロールして開きます。
  5. [Other Linker Flags] に移動し、ダブルクリックしてポップアップを開きます。
  6. フラグがリストにない場合は、[]をクリックして追加します。
警告: この フラグが必要になるのは、iOS エージェントが実行時に呼び出すことができるメソッドでカテゴリを定義するためです。デフォルトでは、これらのメソッドはリンカによってロードされません。その結果、「unrecognized selector」という実行時の例外が取得されます。 を使用すると、メソッドが確実にロードされます。

Swift Package Manager のインストール

注: Swift Package Manager のインストールは、iOS エージェント 23.10.1 以降でサポートされています。
Splunk AppDynamics iOS SDK パッケージを追加するには、Xcode 環境で次の手順を実行します。
  1. File > Add Packages にアクセスします。
  2. 検索バーで、次の GitHub URL を指定します。
  3. 追加するバージョンを指定します。
  4. Add Package をクリックします。
  5. パッケージとターゲットアプリケーションを選択します。
  6. Add Package をクリックします。

パッケージを追加したら、次の手順を実行します。

  1. 必要なライブラリを追加します。
  2. -Objc フラグを設定します。
  3. 各ビルドに dSYM ファイルを自動的にアップロードします。

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 may want to upgrade the iOS SDK in your app manually.
  1. Download the updated SDK.
  2. Replace the .framework file with the updated SDK.
  3. Rebuild your app to apply the changes.