平台
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
| Need | Why |
|---|---|
| a Mac | the iOS Simulator only runs on macOS |
| Xcode | it brings the Simulator, simctl and the compiler for your app |
| an iOS runtime | the iOS version the simulator runs; Xcode installs one |
| CocoaPods | only 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.appAdd 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/mobileWithout 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 iosok 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.0Without --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.
| What | Reaches the proxy |
|---|---|
| the app's own calls | yes: fetch, URLSession and libraries built on them |
| a Safari view | yes, the checkout page WebBrowser.openBrowserAsync opens |
| a sign-in session | yes, ASWebAuthenticationSession (openAuthSessionAsync) |
| other simulators, the Mac | no: 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
| Works | Not yet |
|---|---|
| Expo, React Native, SwiftUI and UIKit apps | getByRole("heading"): iOS reports no heading role |
locators, expect, screenshots, the agent | tests on a Flutter app, which only builds so far |
| Safari views and sign-in sessions | physical iPhones, and keys other than Enter |
| the fault matrix, on one simulator or several | reading mail from a test, saved sessions |
| films of each attempt, the app's log | moving the device's own clock |