The apple-app-site-association file is a JSON file, named with no extension, that a website serves at /.well-known/apple-app-site-association to list the apps allowed to open its links and use its other associated domain services (Apple Developer, Supporting associated domains).
Its main benefit is trust. Only the owner of a domain is able to put a file on it, so an app listed there is one the website chose, which is what makes a Universal Link safe where a custom URL scheme is open to any app that registers it (Apple, Allowing apps and websites to link to your content). Timing shapes everything after setup: Apple's content delivery network (CDN) requests the file within 24 hours, and devices check for updates about once a week after the app is installed (Apple, Supporting associated domains).
The AASA file holds an applinks section for Universal Links and optional sections for shared passwords, App Clips and Handoff. Hosting it means HTTPS, a direct answer with no redirect, a copy on every subdomain the app claims, and a CDN that holds Apple's copy between checks. This page covers what the apple app site association file holds, how to write and host it, and how to check it.
How does iOS use the apple-app-site-association file?
iOS uses the apple-app-site-association file to confirm that a domain trusts an app before it lets that app open the domain's links, in four steps:
The app is installed with one or more domains in its Associated Domains entitlement.
The device asks Apple's CDN for each domain's file; on iOS 14 and later the CDN, not the device, fetches it from your server when it has no copy or an old one.
The system checks that the file lists the app's ID and keeps the URL patterns the file gives that app.
A tap on a link that matches a pattern opens the app; any other link opens in the browser.
Apple's guide to configuring an associated domain describes step 2 the same way: the system "fetches the corresponding Apple App Site Association (AASA) file from an Apple-managed content delivery network". In practice, most failures sit in step 2, where the CDN never gets the file at all. The file is one half of Universal Links; the entitlement and the code that handles the link are the other. The sections below take the file apart, starting with its keys.
Which keys make up the file?
The keys that make up the file are one top-level section per service, with applinks holding a details array whose entries pair appIDs with components. This is Apple's current sample, shortened:
{
"applinks": {
"details": [
{
"appIDs": [ "ABCDE12345.com.example.app", "ABCDE12345.com.example.app2" ],
"components": [
{
"/": "/help/website/*",
"exclude": true,
"comment": "Matches any URL with a path that starts with /help/website/ and instructs the system not to open it as a universal link."
},
{
"/": "/buy/*",
"comment": "Matches any URL with a path that starts with /buy/."
}
]
}
]
},
"webcredentials": {
"apps": [ "ABCDE12345.com.example.app" ]
},
"appclips": {
"apps": [ "ABCDE12345.com.example.MyApp.Clip" ]
}
}The top-level sections follow the services of the Associated Domains Entitlement:
applinks: Universal Links, and the only section with a
detailsarray (Apple, Supporting associated domains).webcredentials: shared web credentials, so Password AutoFill offers the site's saved passwords in the app.
appclips: the App Clip that the domain launches.
activitycontinuation: Handoff between the website and the app.
Every app ID is written as the application identifier prefix, a dot and the bundle identifier, for example ABCDE12345.com.example.app. Apple's current sample has no apps key inside applinks; Branch's 2017 guide says that array "must be present", a rule of the old format. Add only the sections the app uses, since an empty one does nothing. The part that decides which links open the app is components, so it comes next.
How do components match a URL?
Components match a URL by comparing its path, query and fragment with patterns, in the order the array lists them (Apple, applinks.Details.Components). Each component takes these keys:
Key | What it matches |
|---|---|
| The URL path; the default is |
| The query, as one pattern or a dictionary of query item names and value patterns |
| The fragment |
| When true, a match stops the search and keeps the URL out of the app; the default is false |
| Nothing: the system ignores it |
| Whether matching is case-sensitive; the default is true |
| Whether URLs are percent-encoded; the default is true |
Patterns take two wildcards: * matches zero or more characters and ? matches one, while ?* matches at least one. Two rules decide most results. A URL matches only when it matches every key the component sets, so {"/": "abc", "?": "def"} matches https://www.example.com/abc?def but neither /abc alone nor ?def alone, as Apple's example shows. The first matching component wins, so put every exclusion above the wider pattern it carves out of. A file with many similar patterns gets shorter with the two keys in the next section.
What do defaults and substitution variables change?
Defaults set caseSensitive and percentEncoded once for many patterns, and substitution variables let one pattern stand for a list of values (Apple, applinks.Defaults and applinks.SubstitutionVariables). A defaults object under applinks applies to the whole domain, one inside a details entry applies to that entry's apps, and a value set on a single component overrides both: "The more specific definition overrides the less specific."
A substitution variable is a name with an array of strings. Apple predefines eight:
$(alpha),$(upper)and$(lower): ASCII letters, all, upper case or lower case.$(alnum),$(digit)and$(xdigit): alphanumeric characters, decimal digits or hexadecimal digits.$(region)and$(lang): ISO region codes such as US, and ISO language codes such as en.
Apple's example defines its own variable and combines it with two built-in ones:
{
"applinks": {
"substitutionVariables": {
"food": [ "burrito", "pizza", "sushi", "samosa" ]
},
"details": [{
"appIDs": [ "ABCDE12345.com.example.app" ],
"components": [
{ "/" : "/$(lang)_$(region)/$(food)/" }
]
}]
}
}One pattern now covers every language, region and dish, where the old format needed a line for each. None of the top results for this query names either key, yet they are the shortest way to keep a large site's file small. A small file matters most when several apps share it.
How does one file serve several apps?
One file serves several apps by listing several IDs in one appIDs array, so they share the same patterns, or by giving each app its own details entry, so each takes different URLs. Apple's reference says "The first match wins, allowing you to designate one app to handle specified URLs in your website, and another app to handle the rest." Place the entry for the narrower paths first.
The same file reads in two formats: the current appIDs and components, supported from iOS 13 according to Apple's reference, and the legacy appID string with a paths array. Expo's docs suggest shipping both formats in details, newest first, to reach older iOS versions. Apple's TN3155 Debugging universal links says the opposite: "Please avoid mixing formats. Doing so may result in unexpected behavior for universal links." Follow Apple and write the current format only. With the keys settled, the file is ready to write.
How do you create an apple-app-site-association file?
You create an apple-app-site-association file by writing the applinks section by hand from two IDs and a list of paths, then saving it without an extension:
Find the application identifier prefix, usually the 10-character Team ID under Membership in your Apple Developer account.
Copy the bundle identifier from the app target in Xcode.
Write one
detailsentry withappIDsset to the prefix, a dot and the bundle identifier.List the paths the app opens in
components, with exclusions above the patterns they narrow.Add
webcredentialsorappclipsonly when the app uses them.Run the JSON through a linter.
Save it as
apple-app-site-association, with no.jsonextension.
An apple app site association generator fills in these same keys, so read its output against Apple's sample before you upload it. The usual slip is a Team ID from the wrong developer account, after an app moves between teams. The file pairs with the entitlement and the link handler inside the app, which the guide to deep linking on iOS sets up. Once written, the file needs a home on every domain.
How do you host the file?
You host the file by serving it directly at one fixed address on every domain the app claims, in the order a request meets each rule:
Upload it to
https://<fully qualified domain>/.well-known/apple-app-site-association.Serve it over HTTPS with a valid certificate.
Answer with a 200, never a 301 or 302 redirect.
Allow every IP address, region and user agent to fetch it.
Repeat it on every subdomain in the entitlement.
Apple says "You must host the file using https:// with a valid certificate and with no redirects", and TN3155 adds that the file must be reachable "in all geographical locations, from any IP address" and that "your server should accept all user agent requests." Subdomains are the rule people miss: www.example.com and example.com are two domains with two files, and a file on the root serves applinks:*.example.com but not applinks:www.example.com (TN3155). Some older guides name the root path /apple-app-site-association; Apple's current pages name only /.well-known/. An apple app site association 404 means the file isn't at that exact path, or a firewall, login or bot rule blocks it. The response header is the last part of hosting.
Which Content-Type header works for the file?
Serve the file as application/json. Apple's current pages name no content type, but application/json is what validators check, Smler's among them as the second of its five checks. The other type in search results, application/pkcs7-mime, belongs to the signed file of iOS 8: "If your app runs in iOS 8, the file must have the MIME type application/pkcs7-mime and it must be CMS signed" (Kai Hao, 2019, quoting the old rule). A modern unsigned file doesn't need it.
The header alone doesn't settle whether iOS reads a file: on 2 December 2026, www.apple.com served its own file as application/octet-stream. application/json is the safe choice because it passes every check. Many static hosts serve extensionless files as text/plain, so set a header rule for that one path, or set the content type in the object's metadata on S3 or CloudFront (Smler, AASA validator page). Size has a limit too: Expo's docs say "The uncompressed apple-app-site-association file cannot be larger than 128kb", and Branch dates the limit to iOS 9.3.1; Apple's current pages read on 2 December 2026 don't state one. A hosted file still reaches devices only through Apple's copy.
How does Apple's CDN cache the file?
Since iOS 14, devices fetch the file from Apple's CDN instead of your server; the CDN requests it within 24 hours, and devices check for updates about once a week after the app is installed (Apple, Supporting associated domains).
Two things follow. A fix on your server waits for the CDN and then for the device's next check, and TN3155 says "There is no direct CDN invalidation option"; to fetch a newer file on a test device at once, reinstall the app. Expo's docs say iOS reads the file only at install or at an App Store update; Apple's newer word is the weekly check.
For a server the public internet doesn't reach, Apple gives an alternate mode that skips the CDN: write the entitlement as applinks:example.com?mode=developer, sign the app with a development profile, and turn on Associated Domains Development under Settings, Developer on the device. Remove the query string before you submit the app to the App Store (Apple, Configuring an associated domain).
To see what Apple holds now, request https://app-site-association.cdn-apple.com/a/v1/<domain>, the address OrbitKit's guide names. On 2 December 2026 it returned apple.com's file, and a 404 for app.smler.io, which serves no file of its own. Comparing that copy with your server's tells you whether a change has reached Apple yet. The next step is to check the file the way iOS reads it.
How do you validate an apple-app-site-association file?
You validate an apple-app-site-association file with four checks, from the raw response to the patterns:
Request it with
curl -v https://example.com/.well-known/apple-app-site-associationand read the status and headers.Request it again with a random user agent, as TN3155 shows:
curl -A "MyAgent-Bot/*" https://example.com/.well-known/apple-app-site-association.Run
sudo swcutil dl -d example.comon a Mac to download it, thensudo swcutil verify -d example.com -j ./example.json -u https://example.com/testand read "matched" or "blocked match".Run a validator that fetches the file and checks it.
To check apple app site association hosting in one step, Smler's free AASA validator runs five checks in order: file availability, content type, valid JSON, the applinks object and a details array with at least one entry. It works for any domain, whoever hosts the file, and it doesn't judge app IDs or patterns, so compare those with the Xcode project and with swcutil verify. Run the checks again after every deploy, because a new redirect rule breaks a file that passed last week. A file that fails one of them is a file iOS ignores.
Why does iOS ignore an apple-app-site-association file?
iOS ignores an apple-app-site-association file when its CDN fails to fetch it, fails to read it, or finds no match for the app. When the apple app site association is not working, it is one of five causes:
Blocked: a 301 or 302 on the path, or a 403 or 404 from a firewall, region rule or login (TN3155).
Missing subdomain: a domain in the entitlement with no file of its own (TN3155).
Wrong app ID: a prefix or bundle identifier that doesn't match the signed app.
Mixed formats:
appIDandpathsbesideappIDsandcomponents(TN3155).Stale copy: a CDN or device copy older than your fix.
Start with the CDN copy, since it shows at once whether Apple has the file you think it has. When the file passes every check and links still open Safari, the cause sits in the app or on the device, and the guide to universal links not working tests for all nine causes. Android raises the same question with a different file.
Does Android use the apple-app-site-association file?
Android doesn't use the apple-app-site-association file: it reads assetlinks.json at /.well-known/assetlinks.json, a different file that lists the app's package name and the SHA-256 fingerprint of its signing certificate. An app on both platforms serves both files on the same domain. A short link domain needs both as well.
Who serves the file for a short link domain?
The domain's owner serves the file, so a branded short link domain needs a file of its own, the same as any domain in the first step above: the CDN fetches it, the system checks the app ID, and the tap opens the app. Smler hosts the apple-app-site-association file and assetlinks.json per customer domain once the domain is set up in Smler (Smler docs, deep links introduction). Smler supports https links only, Universal Links on iOS and App Links on Android. Smler's pricing meters plans by attributed installs, with 25,000 a month on the Free plan and $19 a month for the first paid plan.