AppDynamics Application Intelligence Platform
3.9.x Documentation
Watch a quick video overview of the main steps of the process.
Direct link: https://appdynamo.wistia.com/medias/pohgsjj2dd
Click the iOS SDK link in step
. This downloads a file named iOSAgent.zip.You must download the SDK separately for each application that you instrument.
Record the application key generated for this application, displayed in step
.You will need this key when you modify the source code.
Uncompress the .zip file you downloaded: you have a file named ADEUMInstrumentation.framework
. Drag this framework file into your project's Frameworks directory.
Edit your app's main.m file to initialize the mobile agent as soon as the app launches. This registers your application, and only needs to be done once in your code.
In your application's main.m, add this import:
#import <ADEUMInstrumentation/ADEUMInstrumentation.h>
Add the call to ADEumInstrumentation initWithKey
passing your application key, recorded in step 3, as a parameter by adding this line of code to the beginning of your application's main() function:
[ADEumInstrumentation initWithKey:@"$CURRENT_APP_KEY"];
Your main.m should look something like this:
#import <UIKit/UIKit.h> #import <ADEUMInstrumentation/ADEUMInstrumentation.h> #import "AppDelegate.h" int main(int argc, char *argv[]) { [ADEumInstrumentation initWithKey:@"$CURRENT_APP_KEY"]; @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
The iOS Agent is compatible with applications created using the Swift programming language.
To your bridging header, add this code:
#import <ADEUMInstrumentation/ADEUMInstrumentation.h>
In your main.swift
or AppDelegate's didFinishLaunchingWithOptions
, initialize the SDK like this:
ADEumInstrumentation.initWithKey($CURRENT_APP_KEY")
Save the file.
The Appdynamics iOS agent requires the following libraries:
Repeat this step for each missing library.
Rebuild your application with the modified application code.
To enable the agent to provide human-readable information in the crash snapshots that are produced if the application crashes, compile with the DWARF with dSYM
file option to create a debug symbols file for the application. For more details about why you would want to do this see Get Human-Readable Crash Snapshots.
Rebuild the Xcode project.
This step is optional but highly recommended if you plan to monitor crashes. AppDynamics needs the dSYM file for the application to produce human-readable stack traces for crash snapshots.
For details about why you should do this, see Get Human-Readable Crash Snapshots.
If you update the application, you need to provide the new dSYM file for the new application version. The dSYM file contains an UUID that links it to a specific Xcode build, so AppDynamics can unambiguously match the correct dSYM file with an incoming crash report with no additional information.
The API uses HTTP basic authentication to send a PUT request to AppDynamics. The username is your AppDynamics account name and the password is your EUM license key.
Send the dSym as a zip archive in the body of a PUT request to the following URI:
https://api.eum-appdynamics.com/eumaggregator/crash-reports/iOSDSym
The content type of the body must be application/zip if the file is a zip file or application/gzip if it is a gzip file. Only these formats are accepted.
This is a sample request and response using the REST API.
The following example uses curl
to send a dSym file named UISampleApp.app.dSYM.zip. The account name is "Example account " and the license key/password is Example-License-Key-4e8ec2ae6cfe. The plus signs replace spaces in the account name when the account name is URL-encoded.
curl -v --upload-file UISampleApp.app.dSYM.zip --user Example+account:Example-License-Key-4e8ec2ae6cfe https://api.eum-appdynamics.com/eumaggregator/crash-reports/iOSDSym
The successful output of the sample request looks like this:
* About to connect() to api.eum-appdynamics.com port 443 (#0)* Trying ::1... * connected * Connected to api.eum-appdynamics.com (::1) port 443 (#0) * Server auth using Basic with user 'Example+account' > PUT /eumaggregator/crash-reports/iOSDSym HTTP/1.1 > Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ== > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 > Host: localhost:7001 > Accept: */* > Content-Length: 0 > Expect: 100-continue > < HTTP/1.1 100 Continue < HTTP/1.1 200 OK < Content-Length: 0 < Server: Jetty(8.1.4.v20120524) < * Connection #0 to host api.eum-appdynamics.com left intact * Closing connection #0
The ADEUMInstrumentation
class has additional methods to allow you to extend the kinds of data you can collect and aggregate using AppDynamics. There are three basic kinds of extensions that you can create:
In addition, if you are using an environment with an on-premise version of the EUEM Processor, you need to update your code to indicate the URL to which your agent should send its beacons.
For more information, see Customize Your iOS Mobile Instrumentation.