Add the SDK
This topic describes how to add the Mobile Analysis component to an iOS client. Mobile Analysis supports three connection types: based on the mPaaS framework, from an existing project using the mPaaS plugin, and from an existing project using CocoaPods. For more information, see Connection types. Select the appropriate connection type for your project.
Prerequisites
Connect your project to mPaaS. For more information, see the following topics:
Add the SDK
Select an approach to add the SDK based on your connection type.
Use the mPaaS Xcode Extension
This method applies if you connect based on the mPaaS framework or from an existing project using the mPaaS plugin.
In the Xcode menu, click Editor > mPaaS > Edit Project to open the project editing page.
Select Mobile Analysis, save the settings, and then click Start Editing to add the component.
In your project, go to Build Settings > Header Search Paths and add the search path for the system library:
/usr/include/libxml2.After you add the SDK, the corresponding framework appears in the
mPaaS/Frameworksfolder of your project. The following table describes the frameworks.Library
Framework
Description
Instrumentation
MPRemoteLogging
Records logs for events that are triggered when the program runs to a specific point.
Automatic instrumentation
MPAutoTracker
Automatically monitors user gestures by hooking UI components. It also automatically monitors events such as application interface switches.
Performance instrumentation
MPPerformance
Provides monitoring data for app memory, power consumption, and traffic.
Crash report
APCrashReporter
Collects, desymbolicates, and categorizes crash logs. It provides analysis tools for developers to resolve crashes and improve application stability.
Interface layer
MPMasAdapter
An interface library that encapsulates logs for keep-alive reports, startup speed, power consumption, and crash reports. For applications that do not use the mPaaS iOS framework, you must manually invoke the interface methods to view the related data in the Mobile Analysis console.
SDK versions 10.1.32 and later provide the
MPMasAdaptermiddle layer to unify and simplify interface calls. For more information about the interfaces, seeMPRemoteLoggingInterface.handMPAnalysisHelper.hin the framework.
Use the cocoapods-mPaaS plugin
This method applies if you connect from an existing project using CocoaPods.
In the Podfile, add the dependency for the Mobile Analysis component:
mPaaS_pod "mPaaS_Log".Run
pod installto complete the connection.
What to do next
To use the SDK, refer to the documentation for your specific SDK version.