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.
Troubleshooting checklist
Section titled “Troubleshooting checklist”Detour SDK not initializedDetour.initialize(...)was not called beforeprocessLink()/getDeferredLink().
- Immediate
NoLink- no matching click found. Verify the link click happened before install.
- Always
NotFirstLaunch- first-launch flag already stored. Reinstall the app for deferred testing.
- App links open browser instead of app
- check Dashboard app-link domain config and 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 manifest
<data android:scheme="...">andLinkProcessingMode.ALL.
- verify manifest
- Analytics events not visible
- ensure valid
apiKey/appIdand callDetourAnalyticsonly after SDK initialization.
- ensure valid
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.