All Products
Search
Document Center

Cloud Monitor:Integrate an iOS application

Last Updated:Jan 22, 2026

Real User Monitoring (RUM) provides comprehensive monitoring for mobile applications. You can use it to monitor and analyze key metrics in real time, such as application performance, crashes, and stuttering. This topic describes how to integrate an iOS application.

Prerequisites: Create an application

  1. Log on to the Cloud Monitor 2.0 console, and select a workspace. In the left navigation pane, click Integration Center.

  2. In the Frontend Application area, click the iOS card, enter an application name, configure other parameters as needed, and then click Create Application.

    Note

    The application name must be unique.

    After the application is created, the integration code is generated at the bottom of the page. The code contains key information such as the AppID and Endpoint.

    You can find the created application on the All Features > Real User Monitoring > Application List page. To view the integration code, go to the application details page and navigate to the Application Settings > Basic Information page.

Important

The SDK integration parameters changed in version 2.0.0 and are not compatible with earlier versions. If you upgrade to version 2.0.0 or later, you must reintegrate the SDK by following the latest documentation. This ensures that the SDK initializes correctly.

Step 1: Integrate the SDK

Automatic integration with Cocoapods (recommended)

  1. Add the latest version of the SDK to the Podfile in your Xcode project.

    source 'https://github.com/CocoaPods/Specs.git'
    
    target 'iOSDemo' do
      # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
      use_frameworks!
    
      # Import the Alibaba Cloud ARMS RUM SDK
      pod 'AlibabaCloudRUM', '2.1.0'
    end
  2. In the project's root directory, run the following command to update the Pod environment.

    pod install --repo-update

Manual integration

  1. Download the SDK and decompress it.

    The .zip file contains the following content:

    • AlibabaCloudRUM.xcframework

    • AlibabaCloudRUMSDK.xcframework

  2. Configure the project.

    1. In Xcode, choose File > Add Files to "Your Project Name".... In the dialog box that opens, select the two component packages that you downloaded in the previous step, and click Add.

      Note
      • The steps may vary slightly depending on the Xcode version.

      • You can select "Copy files to destination".

      image

    2. In your project settings, go to target > Build Phases > Link Binary With Libraries and add the following dependencies.

      • libc++.tbd (required)

      • libresolv.tbd (required)

      image

    3. Go to target > Build Settings, search for Other Linker Flags, and add the -ObjC compilation flag.

      Important

      Ensure that the -ObjC flag is entered correctly.

      image

Step 3: Import the header file

Import the header file in main.m or AppDelegate.m.

Objective-C

@import AlibabaCloudRUM;

Swift

import AlibabaCloudRUM

Step 4: Initialization

Initialize the SDK in the main function or the - application:didFinishLaunchingWithOptions: method.

Objective-C

[AlibabaCloudRUM setEndpoint:@"<your endpoint>"];// Obtain the Endpoint when you create the RUM application.
[AlibabaCloudRUM setWorkspace:@"<your workspace>"];// Obtain the Workspace when you create the RUM application.
[AlibabaCloudRUM start:@"<your serviceId>"];// Obtain the ServiceId when you create the RUM application.

Swift

AlibabaCloudRUM.setEndpoint("<your endpoint>")// Obtain the Endpoint when you create the RUM application.
AlibabaCloudRUM.setWorkspace("<your workspace>")// Obtain the Workspace when you create the RUM application.
AlibabaCloudRUM.start("<your serviceId>")// Obtain the ServiceId when you create the RUM application.

Integration validation

After you run the application, the message "AlibabaCloudRUMSDK init success" in the console indicates that the SDK is initialized successfully. For example:

[AlibabaCloudRUM] [INFO   ] [RUM] <start> AlibabaCloud RUM init success