Updated on 2025-12-29 GMT+08:00

Connecting Agents

Procedure

  1. Log in to the APM console.
  2. Click on the left and choose Management & Governance > Application Performance Management.
  3. In the navigation tree on the left, choose App Monitoring > App List. On the displayed page, click Connect Mobile App.
  4. Select Android for App Type. Select an application from the drop-down list and enter a mobile app name.
  5. Select one or more SDK extended configuration items. You can also select no items. The data of unselected items will not be displayed.
  6. Click Create Mobile App.
  7. Track the service.

    • Android SDK access
      1. Click Download to download the configuration file.
      2. Place the downloaded file in the root directory of the project, as shown in the following figure.
        Figure 1 Root directory of the Android project
      3. Add SDK dependencies.
        1. Add the Maven repository to settings.gradle.
          pluginManagement {
          ...
          repositories {
            ...
            // Add this content:
            mavenCentral()
            }
          }
          dependencyResolutionManagement {
            ...
            repositories {
            ...
            // Add this content:
            mavenCentral()
            }
          }
        2. Add plug-in dependencies to build.gradle.
          buildscript {
          dependencies {
          ...
          classpath 'io.github.apm-sdk:apm-sdk-plugin:{version}'
          ...
          }
          }
          plugins {
          ...
          id 'org.jetbrains.kotlin.android' version 'KOTLIN_VERSION' apply false // Add kotlin 1.6.20 or later.
          ...
          }
        3. Add dependencies to app/build.gradle.
          plugins {
          ...
          id 'org.jetbrains.kotlin.android'
          id 'kotlin-kapt'
          id 'com.cloud.apm.plugin'// Add dependency plug-ins.
          ...
          }
          dependencies {
          ...
          implementation 'io.github.apm-sdk:apm-sdk-android:{version}'
          ...
          }
    • Flutter access
      1. Click Download to download the configuration file.
      2. Place the downloaded file in the root directory of the project, as shown in the following figure.
        Figure 2 Tracking the Flutter app
      3. Add SDK dependencies.
        1. Add the APM Flutter SDK to flutter_app/pubspec.yaml.
          dependencies:
          ...
            apm_flutter_plugin: {apm_flutter_sdk_version}
        2. Add the APM Android SDK to flutter_app/android/build.gradle.kts.
          buildscript {
            repositories {
            google()
            mavenCentral()
            }
          ...
            dependencies {
          ...
            classpath("io.github.apm-sdk:apm-sdk-plugin:{apm_android_plugin_version}")
            }
          }
        3. Add the APM Android SDK to flutter_app/android/app/build.gradle.kts.
          plugins {
          ...
            id("com.cloud.apm.plugin")
          }
          
          android {
          ...
            dependencies {
          ...
              implementation("io.github.apm-sdk:apm-sdk-android:{apm_android_sdk_version}")
            }
          }