Testing & Troubleshooting
Testing deferred linking on Android has platform constraints, mainly around install referrer availability and app-link verification state.
Deferred flow constraints
Section titled “Deferred flow constraints”- Deferred matching is intended for first-launch flow after install.
- Deterministic matching uses Play Install Referrer
click_idwhen available. - If install referrer is unavailable, SDK falls back to probabilistic matching.
- Repeated deferred attempts in same install/session return
NotFirstLaunch.
Recommended deferred test flow
Section titled “Recommended deferred test flow”- Uninstall the app from the device or emulator.
- Open a Detour link in a browser.
- Install and launch the app.
- Verify
LinkResult.Successwithtype = DEFERRED, or expected fallback (NoLink/Error). - Relaunch the app and confirm the deferred link is not consumed again, that is
LinkResult.NotFirstLaunch.
Testing app links and scheme links
Section titled “Testing app links and scheme links”For app-link/scheme integration (LinkProcessingMode.ALL), verify both cold and warm starts.
App Link via ADB
Section titled “App Link via ADB”adb shell am start -a android.intent.action.VIEW \ -d "https://<your-link-domain>/products/42" \ <your.package.name>Expected: LinkResult.Success with type = VERIFIED.
Custom scheme via ADB
Section titled “Custom scheme via ADB”adb shell am start -a android.intent.action.VIEW \ -d "myapp://products/42" \ <your.package.name>Expected: LinkResult.Success with type = SCHEME (only when LinkProcessingMode.ALL).
App Link verification and the SHA-256 fingerprint
Section titled “App Link verification and the SHA-256 fingerprint”An autoVerify App Link opens your app only if the Dashboard SHA-256 matches the key that signed the installed APK:
| How the app is installed | Signed with | Where to read the SHA-256 |
|---|---|---|
| Google Play, any track | Play App Signing key | Play Console → Protected with Play → Manage Play app signing → App signing key certificate |
Android Studio run / ./gradlew assembleDebug | AGP default debug keystore | keytool -list -v -keystore ~/.android/debug.keystore -storepass android, or ./gradlew signingReport |
./gradlew assembleRelease with your own config | Your release keystore | keytool -list -v -keystore <path-to-your.keystore>, or ./gradlew signingReport |
./gradlew signingReport prints the Store: path each variant really uses, so it stays correct when a project overrides signingConfigs.debug. To check a binary directly: apksigner verify --print-certs app-debug.apk.
Then check what the device made of it:
adb shell pm verify-app-links --re-verify <your.package.name>adb shell pm get-app-links <your.package.name> # expect: verifiedThe complete procedure is described in Finding your Android SHA-256 fingerprint.
Common issues
Section titled “Common issues”Detour SDK not initialized
Detour.initialize(...) was not called before processLink() / getDeferredLink().
Immediate NoLink
No matching click was found. Verify the link click happened before the install.
App/Universal link returns NoLink despite a valid click
Your plan’s click limit may be exceeded. Look for [Detour:CLICK_LIMIT_ERROR] in logcat. See Click limits.
Always NotFirstLaunch
The first-launch flag is already stored. Reinstall the app to test the deferred flow again.
App links open the browser instead of the app
- Check the Dashboard app-link domain config and the manifest intent-filter alignment.
- Confirm the Dashboard SHA-256 matches the key that signed the installed APK. See App Link verification and the SHA-256 fingerprint.
Custom scheme not handled
Verify the manifest <data android:scheme="..." /> entry and that linkProcessingMode is LinkProcessingMode.ALL.
Analytics events not visible
Ensure apiKey and appId are valid, and call DetourAnalytics only after SDK initialization.
Debugging
Section titled “Debugging”Use logcat while testing:
adb logcat | grep -i detourUseful tags from SDK internals:
DetourDetourApiClientInstallReferrerHelperDetourAnalytics
For complete end-to-end sample flows, use Examples.