# Make a simulator and test a push notification

Let Silan make an iPhone simulator, install your build on it, send a test push and read the banner back.

With Xcode on the Mac, Silan makes its own simulator in about 30 seconds and gives it the full testing tool set. This guide makes one, installs your app build, sends a test push to it and reads the notification back. Test pushes on a simulator need no push certificate: Silan injects them locally.

Time: about 15 minutes. The first simulator can take two minutes.

You need:

- Xcode with an iOS simulator runtime on the Mac.
- A simulator build of your app, as a `.app` folder, with an app id such as `com.example.cloudocs`.
- Silan, and for the command-line steps an API key from the **Connections** page under **For developers** (`silan keys create` answers `403` on the current release).

Test pushes are off on iOS 27 simulators, where the system's push command hangs the simulator. The device's health shows a warning. Use a simulator with an earlier runtime for this guide. Android emulators do not take test pushes.

## Steps

1. Open Silan. In the empty Rack, or under **Add a device**, click **Make a simulator** and pick **iPhone simulator**. The line reads **Starting Silan iPhone… About 30 s.** Silan makes **Silan iPhone** (an iPhone 17) and waits for it to serve. Silan never lists or touches simulators you made yourself in Xcode.
2. Watch the sidebar. **Silan iPhone** shows as ready with its live picture. If the simulator stops later, its row says **Stopped** and **Make a simulator** starts it again.
3. Point a variable at the `silan` tool and note the simulator's id.

   ```sh
   SILAN=/Applications/Silan.app/Contents/Helpers/silan
   $SILAN devices --kind simulator
   ```

4. Install your build. The agent tool is `install_app`, with the path on this Mac and `launch` set to true. From the command line:

   ```sh
   $SILAN call installApp deviceId=<device id> \
     --body '{"path":"/path/to/CloudDocs.app","launch":true}'
   ```

   The app opens on the simulator's picture in Silan. Accept its notification permission prompt on the simulator the first time, with a tap in Silan.

5. Send a test push. The agent tool is `send_test_push`, with `app_id` and a `title` and `body`. From the command line:

   ```sh
   $SILAN call sendTestPush deviceId=<device id> \
     --body '{"appId":"com.example.cloudocs","title":"New share","body":"Mia shared Q3 plan with you"}'
   ```

   The reply has `sentAt` and `channel: simulator`. A banner shows at the top of the simulator's picture.

6. Read the notification back. The agent tool is `get_notifications`, which lists what Silan saw on the device even after the banner is gone. From the command line:

   ```sh
   $SILAN call listNotifications deviceId=<device id> appId=com.example.cloudocs
   ```

   The list holds the push with its title, body and the time Silan saw it.

7. Put the three calls into a flow if you want them to repeat. A flow's `wait` step takes a `notification` condition, so a run can send the push from a step and wait for the banner. The [flow guide](/guides/write-and-run-a-flow/) shows the file shape.

For an agent, the same three tools are in the testing and full profiles. Connect your coding app with **Test my app** so it gets them: see [Connect Claude Code and drive a phone](/guides/connect-claude-code-and-drive-a-phone/). Tool pages: [install-app](/reference/mcp/install-app/), [send-test-push](/reference/mcp/send-test-push/), [get-notifications](/reference/mcp/get-notifications/).

## If something goes wrong

- **Make a simulator is missing.** The Mac has no Xcode, or only the command-line tools, or no iOS simulator runtime. The line under **Simulators and emulators** in **Settings › Devices & Drivers** says which.
- **The push call is refused with a health warning.** The simulator runs iOS 27, where test pushes are off. Make the simulator with an earlier runtime.
- **No banner shows.** The app has not asked for notification permission, or you declined it. Open the app on the simulator and allow notifications, then send again.
- **The call says the device is not in your lease.** Another agent holds the simulator. Wait for it to release, or stop its task from the chat.

:::note[Proof]
Making a simulator was proved live on 3 Nov 2026 by a Silan worker: **Silan iPhone** ready in 17.5 seconds, **Silan iPad** in 10.7 seconds, a stopped one started again in 21 to 29 seconds. Source: verify-silan feature map, devices. Test pushes and reading the notification back were proved on iOS 26.5 simulators by a Silan worker (use-case facts, 2a and 2c). Installing a build on a real phone is in testing.
:::