平台

iOS setup

Get a Mac ready to test an Expo, React Native or native iOS app on an iOS Simulator with danwo.

本页还没有中文版,下面是英文原文。

danwo runs the same tests, invariants and fault matrix against an iOS app on a Simulator: an Expo or React Native app, or a native one written in SwiftUI or UIKit. The app's calls, and the checkout page it opens, go through danwo's proxy, so Stripe and the rest are emulated there too. One package, @danwo/mobile, builds your app so it trusts danwo, then runs it on a simulator or emulator. This page gets the Mac ready.

What you need

NeedWhy
a Macthe iOS Simulator only runs on macOS
Xcodeit brings the Simulator, simctl and the compiler for your app
an iOS runtimethe iOS version the simulator runs; Xcode installs one
CocoaPodsonly for an Expo app, or a workspace with a Podfile

No simulator needs to exist: danwo creates its own the first time, an iPhone on the newest iOS you have, and keeps it for later runs.

Get Xcode ready

Install Xcode

Install it from the App Store and open it once, so it finishes installing its components.

Point the tools at it

The command-line tools alone have no Simulator. Select the full Xcode:

sudo xcode-select -s /Applications/Xcode.app

Add an iOS runtime

In Xcode, open Settings → Components and install an iOS Simulator runtime if none is listed.

Add the mobile package

danwo init adds @danwo/mobile when tests drive Mobile or Web and mobile. To add it to a project set up for the web, install it. It must be the same version as @danwo/cli, so name that version if yours is not the latest:

npm install -D @danwo/mobile

Without it, the mobile commands stop and name that install:

danwo device doctor needs @danwo/mobile: npm install -D @danwo/[email protected]

Check the Mac

npx @danwo/cli device doctor --platform ios
ok    Xcode: Xcode 26.6, Build version 17F113 (/Applications/Xcode.app/Contents/Developer)
ok    simctl: xcrun simctl
ok    iOS runtimes: iOS 18.6, iOS 26.5
ok    simulators: danwo creates "danwo iPhone" (iPhone 17 Pro, iOS 26.5) on first use
ok    CocoaPods: 1.17.0

Without --platform, the doctor checks Android and iOS, and passes when either is ready. In a project whose config calls withIosDevice, npx @danwo/cli doctor runs the iOS checks too.

How the network is bound

A simulator shares the Mac's network, but keeps its own proxy setting in memory. danwo sets that setting for its simulator only, and trusts the run's certificate in the simulator's keychain. The Mac's own network settings are never touched.

WhatReaches the proxy
the app's own callsyes: fetch, URLSession and libraries built on them
a Safari viewyes, the checkout page WebBrowser.openBrowserAsync opens
a sign-in sessionyes, ASWebAuthenticationSession (openAuthSessionAsync)
other simulators, the Macno: they keep their own settings

Apps that pin their TLS certificates ignore danwo's certificate, so their calls can't be emulated. Turn pinning off in the build you test.

What works on iOS today

WorksNot yet
Expo, React Native, SwiftUI and UIKit appsgetByRole("heading"): iOS reports no heading role
locators, expect, screenshots, the agenttests on a Flutter app, which only builds so far
Safari views and sign-in sessionsphysical iPhones, and keys other than Enter
the fault matrix, on one simulator or severalreading mail from a test, saved sessions
films of each attempt, the app's logmoving the device's own clock

Next

本页内容

在每个 Pull Request 上运行

每个 Pull Request 一个 GitHub Check 和一条评论,并附上完整的运行记录。

配置 CI