Get the Adobe Experience Platform Mobile SDK
The Adobe Experience Platform SDK is available for Apple iOS (includes iOS, iPadOS, and tvOS) via Cocoapods and Swift Package Manager, and for Google Android via Gradle.
Follow the directions below to include the SDK into your mobile application.
data-variant=info
data-slots=text
data-variant=info
data-slots=text1, text2
- For iOS, XCFramework for different SDK extensions are also available for download from corresponding GitHub repositories. For example, Mobile Core and related extensions XCFramework zip file can be found on the GitHub by selecting Releases.
- For Android, the aar is already available for download from Maven central. For example, Mobile Core extension aar file can be found under the corresponding package by selecting Browse.
From the Data Collection UI
- Select the tag property you created earlier in the Data Collection UI.
- In your tag property's details page, Select the Environments tab on the left nav. The Environments tab lists the different environments where you can publish, e.g. Development, Staging, and Production.
- Select the install package icon (under INSTALL column) for the appropriate environment row. You should see a dialog box titled Mobile Install Instructions.
- On the open dialog box, select the appropriate platform tab Android or iOS.
- Copy the necessary dependencies and initialization code from the dialog box to your mobile application project.
Android
Latest version of the Adobe Experience Platform SDKs for Android supports Android 5.0 (API 21) or later.
iOS
Adobe Experience Platform SDKs for iOS support **iOS 12 or later**; **requires** Swift 5.1 or newer; **and** Xcode 15.0 or newer.
In order to support the new Apple M1 architecture while maintaining support for existing Intel architecture, the Adobe Experience Platform SDKs are now distributed using XCFrameworks. Please see the [current SDK versions](../current-sdk-versions.md) for more information on the latest extension versions.
Installation instructions
If you cannot access the Mobile Install Instructions dialog box in the Data Collection UI, complete the following sections to get the Adobe Experience Platform SDK. If you already completed the steps in the Mobile Install Instructions dialog box, no need to complete these steps.
1. Add dependencies to your project
Each extension needs to be added as a dependency to the mobile application project. The following examples will add the Mobile Core and Profile extensions.
Android
Add the dependencies to build.gradle for each extension.
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:userprofile'
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:signal'
implementation 'com.adobe.marketing.mobile:lifecycle'
data-variant=warning
data-slots=text
iOS
Create a Podfile if you do not already have one:
pod init
Add the dependencies to your Podfile for each extension.
use_frameworks!
pod 'AEPEdgeConsent', '~> 5.0'
pod 'AEPAssurance', '~> 5.0'
pod 'AEPEdgeIdentity', '~> 5.0'
pod 'AEPEdge', '~> 5.0'
pod 'AEPUserProfile', '~> 5.0'
pod 'AEPCore', '~> 5.0'
pod 'AEPIdentity', '~> 5.0'
pod 'AEPSignal', '~> 5.0'
pod 'AEPLifecycle', '~> 5.0'
If Cocoapods cannot not find the dependencies, you may need to run this command:
pod repo update
Save the Podfile and run install:
pod install
2. Add initialization code
Next, you'll need to initialize the SDK by registering all the solution extensions added as dependencies to your project with Mobile Core.
data-variant=warning
data-slots=text
data-variant=warning
data-slots=text
There are two ways to achieve this:
a) Using MobileCore.initialize API (Recommended)
The MobileCore.initialize API provides a simple way to initialize AEP SDK. It automatically registers solution extensions and enables lifecycle tracking, eliminating the need for manual setup. Refer to the API documentation for additional configuration options.
Android Kotlin
data-variant=warning
data-slots=text
import com.adobe.marketing.mobile.LoggingMode
import com.adobe.marketing.mobile.MobileCore
...
import android.app.Application
...
class MainApp : Application() {
override fun onCreate() {
super.onCreate()
MobileCore.setLogLevel(LoggingMode.DEBUG)
MobileCore.initialize(this, "ENVIRONMENT_ID")
}
}
Android Java
data-variant=warning
data-slots=text
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
...
import android.app.Application;
...
public class MainApp extends Application {
@Override
public void onCreate(){
super.onCreate();
MobileCore.setLogLevel(LoggingMode.DEBUG);
MobileCore.initialize(this, "ENVIRONMENT_ID");
}
}
iOS Swift
data-variant=warning
data-slots=text
// AppDelegate.swift
import AEPCore
import AEPServices
...
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
MobileCore.setLogLevel(.debug)
MobileCore.initialize(appId: "ENVIRONMENT_ID")
...
}
}
iOS Objective-C
data-variant=warning
data-slots=text
// AppDelegate.m
#import "AppDelegate.h"
@import AEPCore;
@import AEPServices;
...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore initializeWithAppId:@"ENVIRONMENT_ID" completion:^{
NSLog(@"AEP Mobile SDK is initialized");
}];
...
return YES;
}
@end
b) Manual Extension Registration using MobileCore.registerExtensions API
In older SDK versions, solution extensions must be manually imported and registered with MobileCore using the MobileCore.registerExtensions API.
The following code snippets show how to import and register the Mobile Core and Profile extensions, along with Identity, Lifecycle, Signal, and other extensions for reference.
Android Kotlin
import com.adobe.marketing.mobile.AdobeCallback
import com.adobe.marketing.mobile.Assurance
import com.adobe.marketing.mobile.Edge
import com.adobe.marketing.mobile.Extension
import com.adobe.marketing.mobile.Identity
import com.adobe.marketing.mobile.Lifecycle
import com.adobe.marketing.mobile.LoggingMode
import com.adobe.marketing.mobile.MobileCore
import com.adobe.marketing.mobile.Signal
import com.adobe.marketing.mobile.UserProfile
import com.adobe.marketing.mobile.edge.consent.Consent
import com.adobe.marketing.mobile.edge.identity.Identity as EdgeIdentity
...
import android.app.Application
...
class MainApp : Application() {
override fun onCreate() {
super.onCreate()
MobileCore.setApplication(this)
MobileCore.setLogLevel(LoggingMode.DEBUG)
val extensions: List<Class<out Extension>> = listOf(
Consent.EXTENSION,
Assurance.EXTENSION,
EdgeIdentity.EXTENSION,
Identity.EXTENSION,
Edge.EXTENSION,
UserProfile.EXTENSION,
Lifecycle.EXTENSION,
Signal.EXTENSION
)
MobileCore.registerExtensions(extensions) {
MobileCore.configureWithAppID("<your_environment_file_id>")
}
}
}
Android Java
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Extension;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.adobe.marketing.mobile.edge.consent.Consent;
import com.adobe.marketing.mobile.edge.identity.Identity;
import java.util.Arrays;
import java.util.List;
...
import android.app.Application;
...
public class MainApp extends Application {
@Override
public void onCreate(){
super.onCreate();
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
List<Class<? extends Extension>> extensions = Arrays.asList(
Consent.EXTENSION,
Assurance.EXTENSION,
com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,
com.adobe.marketing.mobile.Identity.EXTENSION,
Edge.EXTENSION,
UserProfile.EXTENSION,
Lifecycle.EXTENSION,
Signal.EXTENSION
);
MobileCore.registerExtensions(extensions, new AdobeCallback () {
@Override
public void call(Object o) {
MobileCore.configureWithAppID("<your_environment_file_id>");
}
});
}
}
iOS Swift
// AppDelegate.swift
import AEPCore
import AEPEdgeConsent
import AEPAssurance
import AEPEdgeIdentity
import AEPEdge
import AEPUserProfile
import AEPIdentity
import AEPLifecycle
import AEPSignal
import AEPServices
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
MobileCore.setLogLevel(.debug)
let appState = application.applicationState
let extensions = [
Consent.self,
Assurance.self,
AEPEdgeIdentity.Identity.self,
AEPIdentity.Identity.self,
Edge.self,
UserProfile.self,
Lifecycle.self,
Signal.self
]
MobileCore.registerExtensions(extensions, {
MobileCore.configureWith(appId: "<your_environment_file_id>")
if appState != .background {
MobileCore.lifecycleStart(additionalContextData: ["contextDataKey": "contextDataVal"])
}
})
...
}
}
iOS Objective-C
// AppDelegate.m
#import "AppDelegate.h"
@import AEPCore;
@import AEPEdgeConsent;
@import AEPAssurance;
@import AEPEdgeIdentity;
@import AEPEdge;
@import AEPUserProfile;
@import AEPIdentity;
@import AEPLifecycle;
@import AEPSignal;
@import AEPServices;
...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
const UIApplicationState appState = application.applicationState;
NSArray *extensionsToRegister = @[
AEPMobileEdgeConsent.class,
AEPMobileAssurance.class,
AEPMobileEdgeIdentity.class,
AEPMobileEdge.class,
AEPMobileUserProfile.class,
AEPMobileIdentity.class,
AEPMobileLifecycle.class,
AEPMobileSignal.class
];
[AEPMobileCore registerExtensions:extensionsToRegister completion:^{
// only start lifecycle if the application is not in the background
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
}];
[AEPMobileCore configureWithAppId: @"<your_environment_file_id>"];
...
return YES;
}
@end
3. Ensure app permissions (Android only)
For Android, the SDK requires standard network connection permissions in your manifest to send data, collect cellular provider, and record offline tracking calls.
To enable these permissions, add the following lines to your AndroidManifest.xml file, located in your app's application project directory:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Additional information
- How to use Gradle for Android
- How to use CocoaPods for iOS
- How to use Swift Package Manager for iOS
- Current SDK Versions
Get help
- Visit the SDK community forum to ask questions
- Contact Adobe Experience Cloud customer care for immediate assistance