This document describes how to replace the individual Crash Analytics, App Performance Analytics, and Remote Log Access SDKs with the all-in-one Alibaba Cloud App Monitor SDK.
Prerequisites
You have integrated one or more of the following products: Crash Analytics, App Performance Analytics, or Remote Log Access.
The top layer depends on the following frameworks.
Crash Analytics: AlicloudCrash, AlicloudApmCrashAnalysis
App Performance Analytics: AlicloudAPM
Remote Log Access: AlicloudTLog
Remove SDK dependencies
Remove the existing SDK dependencies.
target 'YourTarget' do # pod 'AlicloudCrash' # Delete dependency # pod 'AlicloudApmCrashAnalysis' # Delete dependency # pod 'AlicloudAPM' # Delete dependency # pod 'AlicloudTLog' # Delete dependency endRun the installation command:
pod install
Integrate the new SDK
Method 1: CocoaPods (Recommended)
Create or edit your Podfile:
source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/aliyun/aliyun-specs.git' platform :ios, '13.0' use_frameworks! target 'YourTarget' do pod 'AlicloudApmAll', '${ApmVersion}', :subspecs => [ 'AlicloudApmPerformance', 'AlicloudApmRemoteLog', 'AlicloudApmMemAlloc', 'AlicloudApmMemLeak', # 'AlicloudApmMemLeakSwiftSupport', # Optionally, include for Swift object support in memory leak detection. ] endImportantYou can find the
ApmVersionin the iOS SDK release notes.AlicloudApmAll component and dependency details:
The crash analysis component, AlicloudApmCrashAnalysis, is included by default and does not need to be explicitly declared.
Optional capabilities are provided as subspecs and can be included as needed:
Performance analysis: AlicloudApmPerformance
Remote log: AlicloudApmRemoteLog
Memory allocation: AlicloudApmMemAlloc
Memory leak: AlicloudApmMemLeak (AlicloudApmMemLeakSwiftSupport is an add-on for Swift memory leak detection.)
NoteIn the root directory of your Xcode project, locate and edit the Podfile to add the AlicloudApmAll dependency. You can run the
pod search AlicloudApmAllcommand to find the latest version. If a Podfile does not exist, run thepod initcommand in the project's root directory to create one. If you have not installed CocoaPods, first install it from the official CocoaPods website.Run the installation commands:
pod repo update AliyunRepo pod install # If you have not added the Alibaba Cloud CocoaPods repository, run the following command first to add it. # pod repo add AliyunRepo https://github.com/aliyun/aliyun-specs.git
Method 2: Manual
Download the latest SDK package from the quick start documentation.
Unzip the package and add the frameworks:
Drag the following .xcframework files into your project:
AlicloudApmAll.xcframework
AlicloudApmCore.xcframework
AlicloudApmCrashAnalysis.xcframework
AlicloudApmPerformance.xcframework
AlicloudApmRemoteLog.xcframework
AlicloudApmMemAlloc.xcframework
AlicloudApmMemLeak.xcframework
UTDID.xcframework
The figure below illustrates the required steps.
Add the following open-source library in the same way:
SSZipArchive: Download.
Navigate to Build Phases > Link Binary With Libraries and add the following built-in system libraries:
libc++.tbd
libz.tbd
libresolv.tbd
CoreTelephony.framework
SystemConfiguration.framework
Xcode compatibility
When using an earlier version of Xcode, you might need to manually add the following system libraries to ensure compatibility:
libz.tbd
libresolv.tbd
CoreTelephony.framework
SystemConfiguration.framework
Linker settings
If you encounter issues during runtime, try adding the -ObjC flag:
Open your Project Settings.
Navigate to TARGETS.
Select Build Settings.
Find the Linking section.
In Other Linker Flags, add -ObjC.
Upgrade APIs
1. Crash Analysis
If your application depends on the AlicloudApmCrashAnalysis SDK, you do not need to upgrade the APIs.
Old API |
New API |
|
|
|
|
|
|
2. Remote Log Access
Old API |
New API |
|
|
|
|
|
|
3. App Performance Analytics
App Performance Analytics does not provide any APIs.