How to Perform Deep Link Testing on Android and iOS

deep link testing

Summarize this blog post with:

Most customer interactions today, including browsing, booking services, making purchases, or completing payments, happen through mobile apps. And since users expect fast and seamless experiences, businesses are focusing more on creating intuitive user journeys.

Deep links are an essential part of this experience, helping businesses connect users directly to their desired app content via engagement channels like marketing campaigns, referral programs, promotional offers, or emails.

However, deep link implementation issues can lead to poor user experiences. Therefore, testing them thoroughly is important.

In this blog, we will learn what deep links are, their types, and how to test them on Android and iOS devices.

Ensure consistent deep link performance across devices with TestGrid. Request a trial.

TL;DR

  • Deep link testing ensures that deep links launch the app and route users to the intended screen without errors
  • The different types of deep links are default deep links, deferred deep links, and contextual deep links
  • In deep link testing, you need to cover factors like routing, permissions, authentication, app transitions, and error handling
  • To validate deep links on Android, you need to prepare the Android test environment, trigger the link using ADB intent, and verify the navigation flow
  • Testing deep links on iOS can be done by validating Universal Links or custom URL schemes using XCUITest and Safari, then verifying the complete navigation flow
  • Deep link testing helps you detect broken redirects, assess fallback behavior, and enhance security

Deep linking is a technology that connects URLs to specific screens within a mobile app. These links are mostly embedded in emails, SMS campaigns, QR codes, social media posts, advertisements, and websites.

The intent is to send users directly to a particular feature, product, promotional offer, or piece of content. This eliminates unnecessary steps when navigating to the target page in the app and improves content discoverability, user engagement, and overall app usability.

Deep link testing is the process of validating deep links and ensuring that each link is correctly recognized by the operating system, opens the appropriate app, and directs users to the target content in the app.

Here, you also check whether your app is properly configured to support custom URL schemes, Android App Links, or iOS Universal Links, so that operating systems can correctly recognize and route supported deep links to the app.

Also Read: Mobile App Testing: A Comprehensive Guide

Default deep links, which are also called direct deep links, take you to a specific screen in the mobile app only if the app is installed on your device.

In case the app isn’t available, the operating system cannot complete the navigation. So, you’re typically redirected to an app store, browser, or shown an error, based on what the app’s implementation and platform configuration are.

Example: myshoppingapp://product/12345

Deferred deep links allow users to reach the intended content after installing and launching the app, even if it was not installed when the link was first opened.

The flow usually goes like this:

  • You tap the deferred deep link
  • The device’s operating system detects that the app is not installed
  • You’re redirected to the App Store, Google Play Store, or another configured destination for more information
  • You install and launch the app

After the first launch, the app retrieves the deferred deep link information and automatically opens the intended screen and preserves your original user journey.

These links are used mostly for app onboarding, referral programs, and marketing campaigns.

Example: https://shop.example.com/product/12345

Learn More: Web Application Testing: Tools, Types, and Best Practices

Contextual deep links are specialized URLs that take you to personalized content or a page in the app. Contextual deep links are typically implemented as deferred deep links that include additional contextual information like campaign IDs, referral codes, promo offers, user preferences, or attribution data.

If an app is not installed on your phone, you will be guided to download it first. After that, the destination and the associated context will be restored automatically.

Example: https://shop.example.com/product/12345?coupon=SAVE20&ref=summer_sale

These are some of the important factors that you need to validate when you test mobile deep links.

Critical AspectsWhat to Check
App state transitionsDeep links should send your users to the correct app destination regardless of whether the app is closed, running in the background, or already active
RoutingEnsure that every deep link resolves to the intended screen, processes URL parameters accurately, and prevents your users from landing on incorrect, missing, or fallback pages
Permissions and authenticationDeep links must enforce authentication and required permissions and take unauthenticated users to the login page
Error handlingInvalid, expired, malformed, or unsupported deep links should show appropriate fallback screens, error messages, or alternative navigation rather than causing crashes
External entry pointsWhen launched from external sources such as email clients, messaging apps, QR codes, push notifications, or social media platforms, deep links should lead to the correct app destination

Also Read: Comprehensive Mobile App Testing Strategy Explained

1. Prepare the Android Test Environment

Set up a physical Android device or emulator and install the build you want to test. Confirm that the app’s deep link intent filters are correctly defined in the “AndroidManifest.xml” file.

If you’re testing verified Android App Links, ensure that “android:autoVerify=”true”” is enabled in the relevant intent filter and that a valid Digital Asset Links file is hosted at “https://yourdomain.com/.well-known/assetlinks.json.”

You also need to install the Android SDK Platform Tools, which include Android Debug Bridge (ADB). ADB allows you to invoke and validate deep links from the command line.

After setting up the test environment, use ADB to send an Android intent containing the deep link URL.

The adb shell am start command sends an “action_view” intent, allowing Android to resolve the matching intent filter and launch the appropriate activity.

For an HTTPS Android App Link, use:

adb shell am start -W \

  -a android.intent.action.VIEW \

  -c android.intent.category.BROWSABLE \

  -d "https://example.com/products/123"

For a custom URL scheme, use:

adb shell am start -W \

  -a android.intent.action.VIEW \

  -d "myapp://products/123"

If you’re testing verified Android App Links, you can also check the domain-verification status with: adb shell pm get-app-links com.example.app (supported on Android 12 and later).

Check whether the deep link leads to the expected screen without errors. Confirm that all parameters, such as product IDs, referral codes, and campaign information, are received and processed correctly.

Test the link while the app is in the foreground, running in the background, and completely terminated. If the destination requires authentication, confirm that users are directed to the login screen and returned to the original destination after signing in.

You should also test malformed or missing parameters, unsupported URLs, back-button behavior, and the fallback experience when the app is not installed.

Also ReadMastering Automated Android App Testing

Apart from manual validation using ADB, you can automate deep link tests using Appium or native Android instrumentation tools such as Espresso. These tests can be incorporated into your existing test framework and executed across supported devices and Android versions.

Appium’s UiAutomator2 driver allows you to launch deep links using the “mobile: deepLink” command and validate complete user flows on physical devices or emulators.

Map<String, Object> args = new HashMap<>();

args.put("url", "myapp://products/123");

args.put("package", "com.example.app");

driver.executeScript("mobile: deepLink", args);

Replace the URL and package name with the values used by your app.

For native Android instrumentation tests, you can launch an activity with a deep link intent using “ActivityScenario.” You can then use Espresso to interact with the app and verify that the correct screen, UI elements, and navigation flow are displayed.

val deepLinkIntent = Intent(

    Intent.ACTION_VIEW,

    Uri.parse("myapp://products/123")

).apply {

    setPackage("com.example.app")

}

val scenario = ActivityScenario.launch<MainActivity>(deepLinkIntent)

onView(withId(R.id.product_title))

    .check(matches(isDisplayed()))

scenario.close()

Replace the URL, package name, activity, and UI element ID with the values used by your app.

1. Prepare the iOS Test Environment

Set up a physical iPhone or iOS Simulator and install the app build you want to test. Confirm that the app supports either Universal Links or custom URL schemes.

For Universal Links, verify that the Associated Domains entitlement is configured and that a valid “apple-app-site-association” file is hosted on the associated domain. For custom URL schemes, confirm that the scheme is registered in the app’s configuration.

You can evaluate deep links via automated testing using XCUITest and manually with Safari.

a. Testing with XCUITest

To test deep links manually with Safari, open Safari, enter a Universal Link or custom URL scheme, and verify that iOS launches the appropriate app and navigates to the expected screen.

If the app isn’t installed, verify that the expected fallback behavior (such as opening the website or App Store) occurs.

func testProductDeepLink() throws {

    let app = XCUIApplication()

    let url = try XCTUnwrap(

        URL(string: "myapp://products/123")

    )

    app.open(url)

    XCTAssertTrue(

        app.staticTexts["Product Details"]

            .waitForExistence(timeout: 5)

    )

}

b. Testing with Safari

XCUITest allows you to open a deep link and verify that users are directed to the correct screen with the expected UI elements and data. This method is useful for regression testing because it supports repeated validation across different iOS devices and versions.

func testProductDeepLink() throws {

    let app = XCUIApplication()

    let url = try XCTUnwrap(

        URL(string: "myapp://products/123")

    )

    app.open(url)

    XCTAssertTrue(

        app.staticTexts["Product Details"]

            .waitForExistence(timeout: 5)

    )

}

Also Read: iOS App Testing: A Comprehensive Step-by-Step Guide

Deep links are often the primary entry point to critical user journeys, including product pages, promotions, and referrals, which can drive conversions. When these links fail, users may abandon the journey altogether. And this can impact your campaign performance and revenue.

Deep link validation helps you:

  • Confirm that authentication, user sessions, and post-login redirects work as expected
  • Ensure query parameters, referral codes, and campaign data are passed and processed correctly
  • Verify fallback behavior by redirecting users to the appropriate webpage or app store when required
  • Detect routing, configuration, and compatibility issues before they impact end users
  • Improve security by verifying that only authorized apps can handle supported App Links and Universal Links

Emulators and simulators are useful during early development, but they do not fully reproduce how deep links behave on physical devices under real usage conditions.

Browser behavior, device manufacturer customizations, hardware characteristics, network conditions, and operating system versions can affect how an Android App Link, iOS Universal Link, or custom URL scheme is processed.

Testing deep links on real devices helps you verify that links open the correct app, screen, or fallback page across different device and operating system combinations.

TestGrid gives you access to a real device cloud where you can test deep-link workflows on physical Android and iOS devices without maintaining an internal device lab.

You can test application behavior under network conditions such as 2G, 3G, 4G, 5G, unstable Wi-Fi, and offline scenarios (including airplane mode, where supported), depending on your TestGrid environment and configuration.

You can also run existing automated tests using frameworks such as Appium, Espresso, XCUITest, and Selenium.

TestGrid supports parallel execution across multiple devices, browsers, and operating system versions, along with CI/CD integrations for tools such as Jenkins, GitHub Actions, GitLab, and Azure DevOps.

Execution evidence includes logs, screenshots, video recordings, network information, crash details, and device-performance metrics such as CPU usage, memory consumption, battery impact, network performance, and UI response times.

These diagnostics help you investigate cases where a deep link opens the wrong destination, fails to launch the app, or behaves differently on a specific device.

Get access to TestGrid’s Real Device Cloud. Request a free trial today.

Frequently Asked Questions (FAQs)

A deferred deep link is a specialized link that preserves your user’s intended app page or screen even when the app isn’t installed on the device. The link instead of losing the navigation context, restores the original destination after installation and the first app launch, and creates a continuous user journey from the initial click to the relevant content within the app.

Yes. You can automate app deep link testing both on Android and iOS with the help of Appium, although the implementation differs by platform. It allows you to validate authentication flows, URL parameters, and navigation across different devices, operating system versions, and app states.

Yes, definitely. Emulators and simulators can be useful during development. But testing your deep links on real devices is essential to assess app associations, browser interactions, authentication flows, and OS-level routing under real usage conditions.

It actually depends on the type of deep link. Default deep links require you to install them to open the target screen for testing. However, you don’t need to install the app to test deferred deep links because they are inherently designed for users who don’t have the app installed. They redirect you to the app store and, after installation and first launch, navigate to the correct app destination.

App Links are Android’s secure deep linking mechanism. Universal Links provide the same functionality on iOS. Both use standard HTTPS URLs to open content within the app when the association is successfully verified and the app is installed; otherwise, they typically fall back to the corresponding website. They differ in platform and verification. App Links use Digital Asset Links. Whereas Universal Links use the Apple App Site Association (AASA) file.