Apple-App-Site-Association: Setup, Hosting and Debugging
The apple-app-site-association file decides which URLs open in your iOS app. What goes in it, where it must live on every host, what Apple's CDN serves in practice, and how to debug the link that opens Safari.
You tapped a link. It opened Safari. The app is installed, the URL looks right, and nothing on screen tells you what went wrong.
The apple-app-site-association file (AASA) is the first place to check. It is a JSON document with no file extension, served over HTTPS at https://<domain>/.well-known/apple-app-site-association on every host named in your app's Associated Domains entitlement. Since iOS 14 the system fetches it through an Apple-managed CDN rather than from your server directly. Get the file, the hosting path, and the entitlement right and Universal Links work. Get any one wrong and the link goes to Safari -- no error, no log entry, nothing.
What follows is the complete setup in one place, including parts of Apple's documentation that have been dropped from the current pages.
The JSON that controls which URLs open your app
A complete file for a shopping app, using the current format:
{
"applinks": {
"details": [
{
"appIDs": ["ABCDE12345.com.example.shop"],
"components": [
{ "/": "/help/*", "exclude": true,
"comment": "Help center always stays on the web" },
{ "/": "/product/*", "?": { "web": "1" }, "exclude": true,
"comment": "Product links carrying ?web=1 stay on the web" },
{ "/": "/product/*",
"comment": "Every other product page opens in the app" },
{ "/": "/orders", "#": "track",
"comment": "Order tracking, only with the #track fragment" },
{ "/": "/s/*", "caseSensitive": false,
"comment": "Short links, matched regardless of capitalization" }
]
}
]
},
"webcredentials": { "apps": ["ABCDE12345.com.example.shop"] },
"appclips": { "apps": ["ABCDE12345.com.example.shop.Clip"] }
}
appIDs is an array because more than one app can claim the same domain. Each value is your App ID prefix -- usually your Team ID -- then a dot, then the bundle identifier. Apple specifies the format as <Application Identifier Prefix>.<Bundle Identifier> in the associated domains documentation. A value that is only the bundle identifier, with the prefix left off, will not match the app, and Xcode does not warn you about it.
The components array is where the work happens. Each entry is a dictionary of matcher keys, and every key you include has to match for the entry to match:
| Key | Matches | Default |
|---|---|---|
/ |
The URL path component | * (everything) |
? |
The query component, as a pattern or as a dictionary of query-item names and value patterns | * (everything) |
# |
The fragment component | * (everything) |
exclude |
Stops matching and keeps the URL out of the app when the entry matches | false |
comment |
Text the system ignores | — |
caseSensitive |
Whether matching is case-sensitive | true |
percentEncoded |
Whether URLs are treated as percent-encoded | true |

Three wildcards are available: * matches zero or more characters (greedily), ? matches exactly one, and ?* matches one or more. The percentEncoded default of true matters if your URLs arrive already encoded, or if your paths contain non-ASCII segments.
Apple's own worked example in the components reference shows how strict the "all components must match" rule is. This entry:
{ "/": "abc", "?": "def", "#": "*" }
matches https://www.example.com/abc?def. It does not match https://www.example.com/abc, and it does not match https://www.example.com?def. The # key matches everything, so the fragment is irrelevant.
Order matters, and so does case. The first matching entry wins -- which is why the?web=1exclusion sits above the general/product/*rule in the example above. Reverse those two and every product link opens the app regardless. AndcaseSensitivedefaults totrue, so/Product/*will not match/product/123. If your URLs are user-generated or your CMS is inconsistent about capitalization, set"caseSensitive": falseon the relevant entries rather than enumerating variants.
The same file can carry other associated-domains services, and you can set defaults for the whole domain once rather than repeating them per entry:
{
"applinks": {
"substitutionVariables": { "store": ["us", "ca", "uk"] },
"details": [
{
"appIDs": ["ABCDE12345.com.example.shop"],
"defaults": { "caseSensitive": false },
"components": [ { "/": "/$(store)/product/*" } ]
}
]
}
}
defaults applies to every pattern in the file and can take any of the keys in the table above -- one line replaces a caseSensitive flag on every entry. substitutionVariables names a set of strings once, and Apple also ships predefined ones, so "/$(lang)_$(region)/*" covers /en_US/ and /fr_CA/ without listing each combination. Avoid names Apple already defines: $(lang), $(region), $(alpha), $(upper), $(lower), $(alnum), $(digit) and $(xdigit).
JSON here is strict: no comments outside comment values, no trailing commas.
The legacy format -- and the one difference that changes behavior
Apple's older format used a single appID string and a paths array, and it is still valid. The archived App Search Programming Guide documents it in full:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "ABCDE12345.com.example.shop",
"paths": ["/product/*", "NOT /help/*"]
}
]
}
}
Legacy paths |
Current components |
|---|---|
appID (a string) |
appIDs (an array) |
apps: [] must be present and empty |
Not used |
"NOT /path/*" for exclusions |
{ "/": "/path/*", "exclude": true } |
* and ? wildcards |
Same, plus ?* for one-or-more |
| Evaluated in order, first match wins | Same |
| Path only | Path, query and fragment |
| Case-sensitive | Case-sensitive by default, switchable |
That last row is the one that changes behavior, and it answers the "paths vs components" question. In the legacy format only the path component is compared. Apple's guide puts it plainly: "only the path component of the URL is used for comparison. Other components, such as the query string or fragment identifier, are ignored."
So a legacy paths entry of /product/* claims /product/123?utm_source=email#reviews just as readily as /product/123. It is more permissive than it looks, and it cannot express "keep this URL on the web" for a password-reset link with a one-time token, or an email link you send with ?web=1. The exclude rule in the example above has no equivalent in paths.
Apple's instruction is to avoid mixing the two formats -- "doing so may result in unexpected behavior for universal links". If your app shipped with the legacy format and you need query-aware rules, convert the whole file to components in one change, then test against the oldest OS version you still support.
The archived guide is also the source of the size limit: for iOS 9.3.1 and later, the uncompressed file must be no more than 128 KB. The current Apple pages we checked do not state a limit.
Hosting: the right path, and the wildcard that catches everyone
The file goes at https://<fully qualified domain>/.well-known/apple-app-site-association, served over HTTPS with a valid certificate, no redirects, no file extension. Apple's current documentation is explicit: you "must host the file using https:// with a valid certificate and with no redirects".
The wildcard does not work the way most people assume.applinks:*.example.comin your entitlement causes the system to fetch the file from the root domain --https://example.com/.well-known/apple-app-site-association. It does NOT cover a named subdomain likewww.example.com. That subdomain needs its own entitlement entry and its own file hosted athttps://www.example.com/.well-known/apple-app-site-association.
From TN3155:
| Entitlement entry | Served by | Not served by |
|---|---|---|
applinks:example.com |
https://example.com/.well-known/apple-app-site-association |
— |
applinks:*.example.com |
The same root file above | — |
applinks:www.example.com |
https://www.example.com/.well-known/apple-app-site-association |
The root file does not cover this |
applinks:foo.example.com |
https://foo.example.com/.well-known/apple-app-site-association |
The root file does not cover this |

The root file covers the root domain and the wildcard. It does not cover a named subdomain -- which is the opposite of what "the root covers everything under it" suggests.
The "no redirects" rule catches most people through the apex-to-www redirect that many hosts apply by default. Host a copy of the file on both rather than letting one redirect to the other. In our checks on 2026-10-11, Apple's CDN followed apple.com's redirect to www.apple.com and served the file anyway, listing both URLs in its fetch header. That is one host on one day. Apple's documentation still says redirects are not supported.
A 403 or 404 does not always mean the file is missing. It can mean your server is turning away certain visitors. Apple's guidance is that the path must be reachable from every IP address, and the server must accept all user agents -- which you can verify with a made-up one:
curl -A "MyAgent-Bot/*" https://example.com/.well-known/apple-app-site-association
What we found when we checked 12 real domains
Since macOS 11 and iOS 14, apps do not request the file from your server. They request it from an Apple-managed CDN, which crawls your domain and caches the result. Two timers run from that point: Apple's CDN requests the file within 24 hours of first encountering the domain, and devices check for updates roughly once a week after app installation. Both figures are Apple's, not measurements.
After fixing your file, expect up to 24 hours for the CDN to refresh -- and up to a week for devices to pick up the change. There is no manual invalidation. Use ?mode=developer (covered in the debugging section below) to skip the CDN entirely during development.
The CDN's copy is readable directly, and the response names the URL it fetched:
curl -s -D - -o /dev/null https://app-site-association.cdn-apple.com/a/v1/example.com
The response carries an Apple-From header naming the origin URL and a Cache-Control header -- max-age was 3600 seconds for some hosts and 21600 for others in our sample. If the body does not match what you deployed, the CDN has not refreshed yet. This endpoint and its headers are observed behavior: Apple does not document them and they can change without notice.
We checked twelve real-world deployments -- Google, Apple, Amazon, YouTube, Spotify, Netflix and others -- to see what the CDN actually accepts. Here is what we found. To run the same check yourself:
for h in google.com www.youtube.com www.amazon.com; do
printf '%-20s %s\n' "$h" \
"$(curl -sS -o /dev/null -w '%{http_code} %{content_type} %{redirect_url}' \
https://$h/.well-known/apple-app-site-association)"
done
Checked 2026-10-11. The content type listed is what the origin returned; in all twelve cases Apple's CDN returned 200 with a copy of the file.
| Host | /.well-known/ |
/ (legacy root) |
Origin Content-Type | Path Apple's CDN fetched |
|---|---|---|---|---|
| google.com | 404 | 200 | application/json | /apple-app-site-association |
| www.google.com | 404 | 200 | application/json | /apple-app-site-association |
| www.duolingo.com | 404 | 200 | application/octet-stream | /apple-app-site-association |
| www.apple.com | 200 | 404 | application/octet-stream | /.well-known/… |
| www.amazon.com | 200 | 200 | application/octet-stream | /.well-known/… |
| developer.apple.com | 200 | 200 | application/json | /.well-known/… |
| www.youtube.com | 200 | 404 | application/json | /.well-known/… |
| open.spotify.com | 200 | 404 | application/json; charset=utf-8 | /.well-known/… |
| www.netflix.com | 200 | 200 | application/json | /.well-known/… |
| www.nytimes.com | 200 | 404 | application/json | /.well-known/… |
| www.uber.com | 200 | 200 | application/json | /.well-known/… |
| www.airbnb.com | 200 | 301 | application/json | /.well-known/… |
These are HTTP-level checks. Nothing here was tested on a device. Two things stand out.
The CDN still fetches from the legacy root path for some major deployments. Google serves its AASA file only at /apple-app-site-association (no .well-known/ prefix), and the CDN fetched it from there and returned a 200. Duolingo does the same. Apple's current documentation names only /.well-known/, and the archived guide allowed both. Use /.well-known/ -- it is what Apple documents and what validators check. Whether a device on a current iOS version still honors the root path was not tested here.
The CDN accepted application/octet-stream from every host that served it that way -- including www.apple.com, Amazon, and Duolingo, all checked 2026-10-11. Some guides say the file must be served as application/json or the fetch fails. Apple's own site uses application/octet-stream, and in all three cases the CDN relabeled what it returned as application/json regardless of what the origin sent. That said, devices on iOS 13 and earlier, and any device using ?mode=developer, fetch from your server directly, and the header's behavior there was not tested. Serve application/json -- Apple's archived guide names it and several guides say it is required. The point here is to help you spend debugging time on the Team ID prefix and the entitlement, not the content type.
The Xcode side: the entitlement has to match
The file and the app have to agree. In Xcode, under Signing & Capabilities, add the Associated Domains capability and one entry per host:
applinks:example.com
applinks:www.example.com
The format is <service>:<fully qualified domain>. No https://, no path, no query string, no trailing slash, and no port -- applinks:example.com:8080 will not open your app. The entitlement reference and Apple's associated domain configuration guide list the services: applinks for Universal Links, webcredentials for shared passwords, activitycontinuation for Handoff, appclips for App Clips, and authsrv for web-service authentication.
Three things on the app side worth checking before anything else:
- The
appIDsvalue in the file must match the app that signed the build. If an agency or a different team signed the build, the App ID prefix in the file has to match that team -- check the prefix on the build you actually shipped, not the one in your own developer account. - Adding the capability in Xcode is not always enough. If you enabled it after the provisioning profile was generated, regenerate the profile and re-sign. The build you ship must carry the entitlement; Xcode adding it to the project does not guarantee it landed in the binary.
- Keep the entitlement list short. Apple's archived guide recommended no more than 20 to 30 domains. Each named subdomain needs its own entry and its own file on its own host -- they add up fast.
If a hosted link service generates and serves the file, the entitlement is the half you still own. ChottuLink's iOS setup guide walks through the same Xcode steps, and the entitlement entry it asks for is applinks:<your link domain> -- for example, applinks:yourapp.chottu.link. That example domain was live on 2026-10-11: it served the file at /.well-known/apple-app-site-association with Content-Type: application/json, Apple's CDN held an identical copy, and the root path redirected. It returned an empty {} because no app is registered on it -- which is what an unconfigured link domain looks like.
Debugging, layer by layer
Universal Links fail without a user-facing error. No dialog, no crash. The link opens Safari and you are left guessing which of four layers broke: your server, the file's contents, Apple's CDN, or the entitlement and the device. Work down this table; each row rules out the layer above it.
| Symptom | Check | Expected | Layer |
|---|---|---|---|
| Nothing served at the path Apple fetches | curl -sI <aasa-url> |
200, no Location header |
Server |
| File loads, app never offered | sudo swcutil verify -d <domain> -j ./aasa.json -u <url> |
Pattern "…" matched. |
File contents |
| You fixed the file and nothing changed | curl -s <cdn-url> |
Body matches what you deployed | Apple's CDN |
| Everything above passes | Settings > Developer > Diagnostics | Link is valid for an installed app | Entitlement / device |

1. Is the file reachable, at the right path, with no redirect?
curl -sI https://example.com/.well-known/apple-app-site-association
You want a 200, no Location header, and a valid certificate. Then confirm the body is valid JSON:
curl -s https://example.com/.well-known/apple-app-site-association | jq .
A trailing comma is enough to break it. If your path sits behind a WAF, a bot-protection challenge, basic auth, or an IP allowlist, Apple's CDN hits the same wall the made-up user agent test does. Allow the /.well-known/ path unconditionally.
2. Do your patterns match what you think? On a Mac, the built-in swcutil does two jobs. dl downloads the file the way the system would and shows what it holds for the domain; verify checks a local file against a URL and reports which component matched.
sudo swcutil dl -d example.com
sudo swcutil verify -d example.com -j ./aasa.json -u https://example.com/product/123
swcutil is macOS only. Apple's technote -- not our testing -- shows the output as Pattern "https://example.com/product/123" matched. for a match and blocked match. for an exclusion. If a path you did not exclude comes back blocked, your pattern did not match -- likely because of case sensitivity or a wildcard that is broader or narrower than you intended. Without a Mac, the curl check from step 1 plus a JSON validator covers hosting and syntax; only the pattern-matching verdict is missing.
Validators, including the popular ones from deep-linking vendors, check the file's shape and sometimes its pattern matching. None can tell you whether Apple's CDN has a current copy or whether your entitlement matches -- two of the four layers. Treat a green validator check as covering step 2 only.
3. What does the CDN have? Read the copy at https://app-site-association.cdn-apple.com/a/v1/example.com and compare it to your deployed file. If it is stale, wait. There is no invalidation.
4. Skip the CDN wait while developing. Append ?mode=developer to the entitlement entry:
applinks:example.com?mode=developer
The system then bypasses the CDN and fetches from your server directly. This also works for a server that is not publicly reachable. It requires Developer Mode on the device and the Associated Domains Development setting in Settings > Developer. Remove the query string before submitting to the App Store.
5. Ask the device. With Developer Mode on, Settings > Developer has a Diagnostics screen that takes a full URL and reports whether it is valid for an installed app.
6. Three things that look like failures but are not:
Pasting the URL into the Safari address bar never opens the app. Apple's technote is direct about this: entering a URL directly into the address bar is direct navigation, and Universal Links do not fire. Test with a tappable link in Notes instead.
Tapping a link while already browsing the same domain in Safari. iOS treats it as in-page navigation. Put the test link on a different subdomain, with its own entitlement entry and its own file.
Testing a file edit against an already-installed build. The device checks about once a week. Deleting and reinstalling forces a fresh fetch, but it comes from Apple's CDN -- so a stale CDN copy returns anyway. Use?mode=developerto skip the CDN.
Third-party browsers are not required to support Universal Links. If links work in Safari and not elsewhere, the AASA file is not the cause.
One final note: when the file is correct and the app opens the wrong screen, or opens and does nothing, the fault is in the app's URL handling, not the file. Apple's guide to handling universal links in your app covers the NSUserActivity contract, including the warning to validate every parameter and discard malformed URLs.
Migrating off Firebase Dynamic Links
If you migrated off Firebase Dynamic Links and your Universal Links stopped working, the AASA file is almost always the reason.
Firebase Dynamic Links shut down on August 25, 2025. Google's deprecation FAQ states that every link the service served -- on custom domains and page.link subdomains alike -- stopped working, and no new links can be created. That FAQ also names the file directly: migrating means hosting "the necessary domain and asset link verification files on the domain you plan to use for your new links".
If your links were on a page.link subdomain, there is nothing left to keep resolving. Google controls that domain, the links are dead, and the only real question is whether your app still receives them from anywhere else.
If your links were on a custom domain you still control, that domain is the asset worth keeping. Three things have to line up:
- The file. The domain you are moving to needs its own AASA file carrying the same
appIDsas before. - The entitlement. The
applinks:entries have to name the new host, which means a new app build. Ship the new entry alongside the old one in the same build so both resolve during the transition, then drop the old entry once analytics show no traffic arriving on it. - The links already in the wild. Emails, QR codes, and printed material point at the old domain. Those taps resolve through that domain's own AASA file -- independent of the entitlement entry in step 2. As long as the file stays live and correct, those links open the app. When you let it lapse, they fall through to the browser. Keep the file in place for as long as those links matter, even after you drop the old entitlement entry.
ChottuLink's Firebase migration page covers the link and SDK side of the cutover. On the file-hosting side: the platform generates and serves the AASA file on your link domain once your bundle ID and Team ID are configured, so you stop maintaining it. That removes a step from the cutover and trades direct control of a file that has to be exactly right. If you would rather keep the file yourself, hand-hosting is free and the checks above cover all of it -- though it gets awkward when several hosts are in the entitlement and no one owns the deploy path into .well-known. ChottuLink's pricing page has the plan ceilings if you are weighing the two.
FAQ
What content type should the file be served with? application/json. Apple's archived guide names it, and several guides say it is required. In our sample Apple's CDN did not reject application/octet-stream from Apple, Amazon and Duolingo themselves, so a wrong header is not the first thing to check. Look at the Team ID prefix, the host matrix and the entitlement first.
Do I need a validator? It covers one layer out of four. A validator reads the file's structure and sometimes its pattern matching, so it catches a broken appIDs value or an exclusion in the wrong order. It cannot see what Apple's CDN cached, and it cannot see your entitlement. Use it for step 2 above, then run the curl checks for the rest.
Does this work the same way on Android? No. Android App Links use a separate file, assetlinks.json, requested from https://hostname/.well-known/assetlinks.json and verified through the app's android:autoVerify="true" intent filter rather than an entitlement. See Verify App Links. Nothing in an AASA file affects Android.