Test a link that opens your app
Give an Agent your app's link, a web link, an in-app event's or custom product page's deep link, or an App Clip link, watch it open your app in Preview, and ask for a fix.
A link can open your app on one screen: a link in an email or a message, a QR code, an in-app event on the App Store, a custom product page. An Agent can open such a link on a Preview device, so you see which screen your app shows without sending the link to your phone first.
Kinds of links
| Link | Looks like | What it needs |
|---|---|---|
| Your app’s own link | myapp://orders/42 |
Your app has its own link name (Apple calls it a custom URL scheme) and handles the rest of the link. If it has none, ask your Agents to add one. Apple explains it in Defining a custom URL scheme for your app ↗. |
| A web link | https://example.com/orders/42 |
Your app and your website are set up for each other. Apple calls this associated domains and explains what each side needs in Supporting associated domains ↗. On the app’s side it’s a capability your Agents turn on: see Turn on iCloud, App Groups or another capability. |
| An in-app event’s or a custom product page’s deep link | One of the two above | The deep link you gave the event or the page. See Promote an event in your app on the store and Make a custom product page for a link or ad. Test it before you send the event or the page to App Review. |
| An App Clip link | https://appclip.apple.com/id?p=com.example.app.Clip |
See Test an App Clip link below. |
Open a link in Preview
-
Make sure Preview has your app’s latest build: open Preview, or tap Reinstall (on iPhone, the app’s icon, Restart App). See Run your app in Preview.
-
Note the device you’re looking at. Its name is on the device menu.
-
In the project’s chat, give the link, the device, and the screen it should open, for example:
Open myapp://orders/42 on the iPhone in Preview. It should show order 42. -
The Agent opens the link on that device. Watch it happen in Preview.
-
The Agent reads the screen the link led to and tells you what it shows. Ask for a screenshot if you want one in the chat.
-
If it’s not the right screen, say what should happen instead. When the Agent has fixed and built the app, ask it to open the link again.
Name the device in your request. Picking a device in Preview changes only what you see; an Agent opens the link on the device you name, or else on the Team’s default device.
Try it with the app closed, too
Your app can get a link while it’s open, or be started by it. Ask for both:
Open myapp://orders/42 on the iPhone in Preview twice: once while the app is open, and once after closing the app.The Agent can close the app on the device before it opens the link.
Test an App Clip link
An App Clip’s real link opens it only once the version with the App Clip is approved and live (see Ship an App Clip). In Preview, an Agent can open the App Clip and hand it a link of your choosing instead:
Open the App Clip on the iPhone in Preview with https://appclip.apple.com/id?p=com.example.app.Clip&item=42, and check it shows item 42.- The device hands the link to the App Clip as a setting the App Clip starts with (an environment variable named
_XCAppClipURL), not the way a real link arrives. Thesimulatorhelp says a debug build of the App Clip has to read the link from there and treat it like a link it was opened with. If yours doesn’t, ask the Agent to add that. - The App Clip starts again for each link: if it’s open, it’s closed first.
- To try the links of your App Clip’s QR codes, give each one with its parameters. See Ship an App Clip.
To open the App Clip from a link on your own iPhone before it’s released, see Try your App Clip from TestFlight before release.
Questions
The web link opened in the browser, not in my app.
The app opens, but not on the right screen.
The app closes when the link opens it.
The Agent says the App Clip opened without its link.
Does this work on an Android phone in Preview?
simulator help says Android phones answer the same commands in Android’s own way, and opening a link isn’t among the commands it lists as Apple-only. Name the Android phone in your request. The App Clip steps are for iPhone and iPad only.