On this page
A working association file connects a website domain to a particular signed mobile app. Before release, check both the file served by each domain and the behavior of the actual release-signed app. A valid JSON file alone does not prove that links will open in the app.
This guide covers Android App Links and iOS Universal Links, including missing and malformed files and the experience when the app is not installed. Current Android and Apple documentation could not be consulted for this article, so confirm platform requirements and version-specific testing procedures against the official documentation before release. The commands and examples below were not executed for this article.
Key Takeaways
- Check
https://<host>/.well-known/assetlinks.jsonfor Android and the Apple association file athttps://<host>/.well-known/apple-app-site-associationor the host root. - Check the initial response without following redirects: it should be accessible over HTTPS, return
200, and contain the intended JSON. - Compare identifiers and signing information with the distributed, signed app, not just a development build. Never publish private keys.
- Test on devices as well as with HTTP tools. OS verification, cached association data, link paths, and user settings can affect the result.
- Test failures on an isolated staging domain, not by breaking a production association file.
Identify the hosts and release artifacts
Make a list of every hostname used in links, such as example.com and www.example.com. Treat them as separate hosts: a successful check for one does not establish that another is configured correctly. Replace example.com and the example identifiers below with your own values.
Gather the release artifact that testers will actually install, its Android package name and signing certificate fingerprint, and the iOS app's signed entitlements. If a store signs or re-signs your distributed build, use the identity of that distributed build rather than assuming your local upload or development signature is the one devices receive.
Check that the app itself declares the intended domains and paths. On Android, inspect the release manifest's VIEW intent filters, including DEFAULT and BROWSABLE, the HTTPS hosts and any path restrictions, as well as android:autoVerify. On iOS, inspect the signed Associated Domains entitlement for entries such as applinks:example.com. An association file cannot compensate for a missing or mismatched app declaration.
Advertisement
Check the deployed URLs without following redirects
From a terminal with curl and Python installed, fetch each file directly. These commands save the response headers and body separately; they do not follow redirects.
curl -sS -D android.headers -o assetlinks.json \
https://example.com/.well-known/assetlinks.json
curl -sS -D apple.headers -o apple-app-site-association \
https://example.com/.well-known/apple-app-site-association
Inspect both header files and bodies. For each request, check:
- The TLS connection succeeds and the initial HTTP status is
200, not a redirect,403, or404. - The response is the intended association file, not an HTML error page or login page. Check that the content type is appropriate for JSON, such as
application/json. - The Apple filename has no
.jsonextension. Apple association files can also be served athttps://example.com/apple-app-site-association; check the location you deploy. - The file is available publicly, without cookies or authentication, for each relevant host.
Avoid redirects at the association-file URLs, including redirects between www and the apex host or from one path to another. A browser reaching the final destination does not prove that platform verification will accept the original URL. Check CDN and reverse-proxy rules as well as your application server.
Check JSON syntax separately:
python3 -m json.tool assetlinks.json > /dev/null
python3 -m json.tool apple-app-site-association > /dev/null
A successful syntax check only means the downloaded body is parseable JSON. It does not verify the schema, identifiers, signature, path matching, or device behavior. If curl fails or the status is not 200, fix that first rather than treating a saved error response as an association file.
Compare Android's file with the signed app
An Android assetlinks.json is an array of statements. This illustrative statement authorizes link handling for one package and certificate; its package and fingerprint are fictional:
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.app",
"sha256_cert_fingerprints": [
"00:01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F:10:11:12:13:14:15:16:17:18:19:1A:1B:1C:1D:1E:1F"
]
}
}
]
Compare package_name with the application ID in the released app, including any release-specific suffix. Compare the SHA-256 fingerprint with the public signing certificate for the artifact users will install. The fingerprint is public identification data; the private signing key and keystore must remain secret.
For an APK, Android's build tools include apksigner. With that tool on your PATH, inspect the actual APK:
apksigner verify --print-certs /path/to/release.apk
Compare the reported signer certificate SHA-256 digest with the deployed fingerprint, accounting for formatting. If users receive a store-signed build, also check the store's app-signing certificate information or an actual distributed artifact. A fingerprint from a debug build or an upload certificate is not necessarily the fingerprint used to sign the installed app. If you distribute builds signed by different certificates, account for each intended certificate in the association configuration.
Compare Apple's file with the signed app
The Apple App Site Association file, often called AASA, identifies apps and the URL paths they can handle. The following is an illustrative path-based file; substitute your signed app's identifier and the paths you intend to support:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "ABCDE12345.com.example.app",
"paths": ["/articles/*"]
}
]
}
}
Compare appID with the signed app's application-identifier entitlement. Its prefix is often the team identifier, but do not assume that is always true; inspect the actual signed entitlement. Also confirm the bundle identifier and that the signed com.apple.developer.associated-domains entitlement includes the relevant applinks: host.
On a Mac with the Apple developer tools available, you can inspect a signed .app bundle:
codesign -d --entitlements - /path/to/YourApp.app
Use the app bundle extracted from the build you intend to test, not an unsigned source project. The AASA path rules and the links used in testing must agree. A valid association for /articles/*, for example, does not establish that an unrelated path will open in the app. Confirm the applicable AASA format and path-matching rules in Apple's current documentation for your deployment targets.
Advertisement
Run the release-test cases
Use a staging host with its own association files and an appropriately configured test build. Keep production files unchanged for negative tests. Record the device OS version, app build, host, path, installation state, and link-opening result for each run. Test on the OS versions and distribution channels you support.
| Case | Setup and action | What to check |
|---|---|---|
| Valid association | Serve valid files with the release app's identifiers and signing details. Install the signed app and tap an in-scope HTTPS link from another app. | The app can receive the link and navigate to the expected content. Also verify the HTTP responses and app declarations if it does not. |
| Missing file | On the staging host, return 404 for the relevant association file. Install or retest the staging build and tap a link. | A fresh verification should not establish the association from a missing file. Check the browser fallback and server logs; account for cached results from earlier runs. |
| Malformed file | Serve invalid JSON on staging, then repeat the device test. | The syntax check should fail, and a fresh verification should not establish the association from that file. Cached associations can obscure this result. |
| App not installed | Uninstall the app and tap an in-scope link. | Confirm the website handles the URL usefully in the browser. Do not assume the OS will automatically send the user to an app store. |
For a meaningful negative test, use a fresh staging hostname or otherwise account for cached association data; merely changing a file may not immediately change a device's behavior. Apple devices may obtain association data through Apple's infrastructure, so a successful direct curl request is not proof that a device has received the latest version. Allow for caching and propagation when investigating changes.
Test links by tapping them in a realistic external context, such as a message or note. Browser behavior, the current browsing context, OS version, and user-selected link preferences can affect whether an app opens. Also test a path outside the intended rules and confirm that your website provides a sensible fallback.
Common Mistakes
- Testing only a debug build. Its package, entitlements, or signing certificate may differ from the release distributed to users.
- Following redirects during the only HTTP check. Inspect the first response instead; a final
200can hide a redirect. - Checking JSON syntax but not its meaning. Compare the app identifiers, public certificate fingerprint, relation, domains, and path rules.
- Checking only one hostname. Apex and
wwwhosts, as well as regional or campaign hosts, need their own review. - Assuming a file update is immediately reflected on devices. Cached data and platform verification can delay or obscure a change.
- Putting signing secrets in the file or a support ticket. Publish only the required public identifiers and certificate fingerprints, never private keys.
Best Practices
Keep a release checklist mapping each link host to its association-file URLs, expected app identifiers, signing fingerprints, and supported paths. Automate checks for direct HTTPS status, content type, JSON syntax, and expected values, but retain device tests for actual link handling. Monitor association endpoints after CDN, DNS, certificate, or routing changes, and maintain a working web experience when the app cannot open a link.
Conclusion
Verify the files as public HTTPS resources, match them to the app that users will actually install, and exercise both successful and failure cases on devices. Treat a passing HTTP or JSON check as one part of release verification—not proof that the entire link experience works.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.