Make Siri, Spotlight or iCloud work in Preview
Preview devices start with Siri, Spotlight indexing, iCloud and a few other services turned off. Ask an Agent to turn on the ones your app needs, then try again.
A new Preview device starts with the background services apps rarely need turned off, to save memory. If your app uses one of them, the feature that needs it may do nothing in Preview, even when your code is right. An Agent can turn a service back on for the device with simulator services (see services in simulator).
Which services start off
The simulator help names these among the services a new device starts without:
| Service | Id the help gives it |
|---|---|
| Siri | siri |
| Spotlight indexing | search |
| iCloud | icloud |
| Photo analysis, Messages, Family Controls, HomeKit | The Agent finds them in the device’s list. |
The list isn’t complete: the Agent lists the device’s services, by category and feature, to see the rest.
Ask an Agent to turn one on
-
Note the device you’re looking at: its name is on the device menu, in the navigation bar on iPhone and over the device on the Mac.
-
In the project’s chat, say which feature does nothing, and on which device, for example:
On the iPhone in Preview, my notes don't show up in Spotlight search. Turn on what the app needs for that. -
The Agent lists the device’s services, then turns on the ones your feature needs with
simulator services enable. -
It tells you which ones it turned on, and any that came back as
pendingorfailed(see below). -
Try the feature again in Preview.
If you know the service, name it:
Turn on Siri and iCloud on the iPad in Preview.The Agent can also turn everything on (all), but the help says these services start off to save memory, so ask for the ones your app uses. To turn them off again, ask for that: the Agent uses simulator services disable.
When a service doesn’t start
| What the Agent reports | What it means |
|---|---|
pending |
The service starts only the next time the device starts up. In a cloud Team, a device started again is a fresh one, with the service off again, so it stays off for now. The simulator help doesn’t say what happens on a local Team’s device. |
failed |
The service couldn’t be changed, and the command reports a failure after it lists the result. Ask the Agent what it says. |
Either way, try the feature on your own iPhone or iPad. See Install your app on your iPhone.
The change stays on the device
The Preview devices are shared by the Team. A service you had turned on stays on for everyone who uses that device, and for Agents that test on it, until someone turns it off. In a cloud Team, a device other than the default one shuts down when nobody watches or uses it for a while, and every device does when the Team goes to sleep. A device started again is a fresh one, with these services off again. Ask the Agent again when you come back.
Before you test
- Siri: Preview plays the device’s sound to you, but doesn’t send your voice to the device, so you can’t speak to Siri in Preview. AirBuild’s Siri & Shortcuts page also says “This is what the build declares. Whether Siri runs an App Intent is tested on a device.” See Let people use your app from Siri and Shortcuts.
- iCloud: the app also needs the iCloud capability. See Turn on iCloud, App Groups or another capability. The
simulatorhelp doesn’t say whether iCloud in Preview also needs an Apple Account signed in on the device.