# Running iPhone Safari smoke tests in Actions

> A GitHub Actions workflow boots an iOS Simulator, opens Mobile Safari, captures evidence, and defines which failures still need a real iPhone.

On 2026-11-27, UNVERCO published a GitHub Actions workflow that boots an available iPhone in the iOS Simulator on a `macos-15` runner and opens a URL in Mobile Safari. It then takes a screenshot and uploads that screenshot as a workflow artifact. The author reports running the exact workflow before publication ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

## Impact of hosted iPhone simulation on release evidence

GitHub describes hosted runners as the machines that execute workflow jobs. Except for single-CPU runners, each hosted runner is a new virtual machine; standard images are available with Ubuntu and Windows, plus macOS. GitHub maintains the installed software list in the `actions/runner-images` repository and links the exact image details from each job's **Set up job** section ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).

The macOS 15 image documentation lists installed Xcode versions and marks one as the default. The workflow relies on `xcrun simctl`, so recording the runner image and Xcode version beside a failed screenshot makes the run reproducible. Do not infer an iOS runtime from the `macos-15` label alone; inspect the image record from the job that ran ([GitHub runner images](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md)).

Apple distinguishes Simulator from a device run. Simulator lets you prototype and test builds on a Mac, while device testing runs on connected hardware. That boundary is why a passing screenshot can establish that a page rendered in the selected simulated environment, but cannot establish behavior tied to physical hardware ([Apple Developer](https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device)).

### Create the smoke workflow

Add `.github/workflows/iphone-safari-smoke.yml` to the repository. Replace `https://example.com` with a deployed test URL that the hosted runner can reach:

```yaml
name: iPhone Safari smoke test

on:
  workflow_dispatch:

jobs:
  ios:
    runs-on: macos-15
    timeout-minutes: 20
    steps:
      - name: Record runner tools
        run: |
          sw_vers
          xcodebuild -version
          xcrun simctl list runtimes

      - name: Boot an available iPhone simulator
        run: |
          UDID=$(xcrun simctl list devices available -j | python3 -c \
            "import json,sys; d=json.load(sys.stdin)['devices']; print(next(x['udid'] for r in d.values() for x in r if x['name'].startswith('iPhone')))")
          xcrun simctl boot "$UDID"
          xcrun simctl bootstatus "$UDID" -b
          echo "UDID=$UDID" >> "$GITHUB_ENV"

      - name: Open the site and capture Safari
        run: |
          xcrun simctl openurl "$UDID" "https://example.com"
          sleep 20
          xcrun simctl io "$UDID" screenshot iphone-safari.png
          test -s iphone-safari.png

      - name: Upload evidence
        uses: actions/upload-artifact@v4
        with:
          name: iphone-safari-screenshot
          path: iphone-safari.png
          if-no-files-found: error
```

The device-selection expression reads JSON and searches the available runtimes. It selects the first device whose name begins with `iPhone`. `bootstatus -b` waits for boot completion. `openurl` sends the deployed URL to the booted simulator, while `simctl io` captures the screen. `test -s` fails when no nonempty image was produced. Those operations come from UNVERCO's published workflow. The example adds tool recording and an explicit artifact check around them ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

Run it from the repository's **Actions** tab with **Run workflow**. A successful job produces the `iphone-safari-screenshot` artifact and logs the Xcode version plus available simulator runtime data alongside the macOS version. Open the PNG and inspect the exact screen the workflow captured. The screenshot is illustrative evidence of one state. It does not assert that navigation or input behavior passed, nor does it cover storage or notification behavior ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners); [UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

Keep the screenshot with the job record. GitHub says each hosted runner includes the runner application and preinstalled tools, while macOS runners also include the operating system's default tools. The expanded **Set up job** section provides **Runner Image** and **Included Software** links for the exact software list. Record both links when reviewing the screenshot so the run identifies the image it used ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).

UNVERCO's published workflow starts with `workflow_dispatch` and passes the fixed `https://example.com` URL to `simctl openurl`. It waits 20 seconds before capturing `iphone-safari.png` ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

### Make failures diagnostic

If the Python expression raises `StopIteration`, the image did not expose an available device whose name starts with `iPhone`. Read `xcrun simctl list devices available` in the log, select a name that exists, or pin the selection to a runtime and device supported by that image. The GitHub job's **Runner Image** link is the record of installed tools for that execution ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).

If `bootstatus` fails or reaches the job timeout, preserve the preceding runtime and device lists. Retry once to distinguish an image-level transient from a repeatable configuration failure. If it repeats, select an installed runtime explicitly instead of assuming which runtime the moving runner label contains. GitHub states that hosted image software is updated weekly and that deployment takes several days, so the exact image link matters during diagnosis ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).

If the artifact exists but shows an error page, check the target independently from the runner. Add a response check before opening Safari:

```sh
curl --fail-with-body --silent --show-error \
  --location \
  --output /dev/null \
  --write-out 'status=%{http_code} type=%{content_type}\n' \
  https://example.com
```

Expected output contains a successful HTTP status and the deployed page's content type. This command verifies the HTTP result that the smoke test depends on; it does not verify Safari rendering. Authentication and private network routing must be configured for the hosted runner before the simulator can load a protected target. The same applies to certificate trust ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).

If the screen needs taps or text entry, replace the fixed delay and screenshot-only check with an automation session. Do the same for overflow assertions or console inspection. UNVERCO points to Appium with the XCUITest driver for interactive journeys. Appium's real-device guide separately documents device provisioning and trust. It also documents signing and WebDriverAgent setup, which is additional work beyond a simulator smoke test ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf); [Appium](https://appium.github.io/appium-xcuitest-driver/latest/real-device-config/)).

The published workflow uses `sleep 20` immediately before `simctl io "$UDID" screenshot iphone-safari.png`. UNVERCO calls this a minimal workflow and separately says that taps and overflow require a WebDriver session. The same applies to tap targets and console errors; Appium with the XCUITest driver is one example ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

### Define what a pass means

UNVERCO reports a parallel repository run covering Chromium and Firefox. It also covered WebKit and an Android 14 emulator alongside the iOS Simulator. The run took about 10 to 13 minutes, with the iOS part slowest. The same report gives about two minutes for its web-only check. These are measurements from that repository, not estimates for another project or guarantees attached to GitHub's runners ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

The report also states the limitation directly: simulators and emulators are not physical phones and do not reproduce real hardware or network behavior. They also cannot reproduce the camera or push notifications. Native applications are outside this evidence too. Keep a separate real-device route for release risks that depend on those surfaces. Apple likewise directs developers to run on a connected device when testing the app on hardware ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf); [Apple Developer](https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device)).

A useful pass statement names the actual observation. The selected hosted image booted a listed iPhone Simulator and Mobile Safari opened the target. The uploaded screenshot showed the expected screen. Add separate assertions for stronger claims. A tap journey needs automation; an offline claim needs a controlled network transition and reload; storage recovery needs a written value and an equality assertion after reopening ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

Desktop device simulation does not replace this check. UNVERCO says desktop simulation changes the user agent along with screen dimensions and viewport. It also changes touch support without turning the underlying engine into iOS Safari. The report names dynamic viewports and safe-area insets as page issues to observe in an iPhone environment. It also names input-font zoom and touch targets. Each still needs a visible assertion for the page under test ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

Record the Android route separately too. The source uses `reactivecircus/android-emulator-runner` on a Linux runner and runs it in parallel with iOS Simulator. An Android pass does not replace the iOS result; each job should upload its own evidence and report its own status ([UNVERCO](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf)).

### Recover without hiding the failure

Do not change the workflow to accept an empty screenshot or ignore a failed URL check. If hosted simulation is unavailable, leave the required check failed and use the documented real-device test path. Appium's setup requirements make the device identity and signing visible. They also expose WebDriverAgent and connection requirements instead of silently treating a simulator result as hardware evidence ([Appium](https://appium.github.io/appium-xcuitest-driver/latest/real-device-config/)).

Document the device and connection prerequisites for that recovery path. Appium requires provisioning and trust for a real iOS device. It also requires signing and WebDriverAgent configuration. Until those prerequisites exist, keep hardware-dependent release risks unverified instead of renaming a simulator screenshot as a real-device regression. Once the device path is ready, repeat the same user journey and retain the device and operating-system version ([Appium](https://appium.github.io/appium-xcuitest-driver/latest/real-device-config/)).

:::caution
GitHub updates software on its hosted images weekly, and the rollout takes several days. Diagnose a changed simulator result against the exact **Runner Image** link in the job log; the `macos-15` YAML label alone is insufficient ([GitHub Docs](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners)).
:::

## Related entries

- [Capabilities](/reference/capabilities/): follow this entry for capability categories and their evidence.
- [Performance](/reference/performance/): follow this entry for performance measurement and loading guidance.
- [Storage](/reference/storage/): follow this entry for browser storage guidance covering quota and persistence.

## Open and unverified

The workflow has not been run in this repository, so its available iPhone model and iOS runtime remain unverified here. Its duration and screenshot result are also unverified. The reported 10-to-13-minute parallel run and two-minute web-only run belong only to the source author's repository.

Whether the first available device selected by the workflow matches a project's target iPhone and iOS runtime remains unverified. Whether a fixed 20-second delay reaches the intended page state also remains unverified for each deployment. Access to a target that needs authentication or private routing remains unverified too, as does custom certificate trust.

Real iPhone behavior for this site's camera and network transitions also remains unverified. The same applies to push notifications and installed-app surfaces. A simulator screenshot cannot close those questions, and no real-device record was supplied for this entry.

## Sources

- [Test iPhone Safari on GitHub Actions without a Mac](https://dev.to/unverco/test-iphone-safari-on-github-actions-without-a-mac-a-working-workflow-and-the-limits-3gbf) (DEV Community)
- [GitHub-hosted runners](https://docs.github.com/en/actions/concepts/runners/github-hosted-runners) (GitHub Docs)
- [macOS 15 runner image](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md) (GitHub)
- [Running your app in Simulator or on a device](https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device) (Apple Developer)
- [Real Device Configuration](https://appium.github.io/appium-xcuitest-driver/latest/real-device-config/) (Appium)