Run Squiggle on a physical iPhone
For AI agents: this page is Markdown at https://squiggle.sh/docs/iphone.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.
Drive and test your app on your own iPhone, over a cable or Wi-Fi: flows, taps, the component graph, performance, and the system alerts and sheets iOS puts over your app, such as Save Password.
You add one config plugin, build your app the way you already do, and run a flow. Squiggle launches the app on the phone, connects to it over the link Xcode uses for the phone, and signs and starts its own helper on the phone the first time a run needs it. The one thing you do on the phone yourself is enter your passcode once, when iOS asks to turn on UI Automation.
Before you start
- A Mac with Xcode, signed in to your Apple developer account in Xcode › Settings › Accounts.
- The iPhone paired with that Mac (connect it by cable once and tap Trust), with Settings › Privacy & Security › Developer Mode on.
- An Expo app with the Squiggle SDK, set up as Set up your app describes, and the Squiggle CLI installed.
- A paid Apple Developer team, for alerts and sheets. Squiggle signs its phone helper with the wildcard development profile Xcode keeps for a paid team. With a free personal team you can still drive your app, but not the alerts and sheets iOS draws over it.
Add the config plugin
Add the SDK to your Expo config’s plugins. It puts Squiggle’s agent into Debug builds for a device, signed with your own team, so Squiggle can drive the app on the phone.
{ "expo": { "plugins": ["@squiggle.sh/react-native"] }}Release builds get nothing from it: no agent, no Squiggle native code. TestFlight and App Store builds are Release builds.
Point Squiggle at the phone
{ "apps": { "ios": "com.acme.shop" }, "device": { "provider": "iphone" }}With more than one iPhone paired, add "id" to device with the phone’s name. If your Mac has profiles of more than one team, add "team" with the team ID to use.
Build as usual
npx expo run:ios --deviceBuild a Debug build, as you would to try the app on your phone, and keep Metro running (npx expo start). Rebuild after adding the plugin: an app built before it has no agent.
Run a flow
squiggle flow sign-inSquiggle launches the app on the phone and runs the flow. The first run also signs Squiggle’s phone helper with your development identity, installs it and starts it, which takes about half a minute; later runs reuse it.
Alerts and sheets that iOS draws over your app are part of the screen Squiggle reads, so a flow targets them like anything else. After a sign-in, iOS offers to save the password:
flow: sign-insteps: - type: { into: { testID: email }, value: maya@acme.com } - type: { into: { testID: password }, value: correct-horse } - tap: { testID: sign-in } - waitFor: { visible: { text: Not Now }, timeout: 15000 } - tap: { text: Not Now }Enter your passcode once
The first time Squiggle starts its helper on a phone, iOS asks on the phone for your passcode to turn on UI Automation. Enter it. The run waits and says so while it does. iOS keeps Settings › Developer › Enable UI Automation on afterwards, so it asks once per phone.
Cable or Wi-Fi
Squiggle reaches the phone through the connection Xcode uses for it, which Apple runs over a cable or over Wi-Fi. A paired iPhone on the same Wi-Fi as your Mac, with the Mac awake, needs nothing changed. If iOS asks you to pair over a cable first, connect it once and tap Trust.
Check the setup
squiggle doctor checks the phone row by row and gives the one thing to do about each row that fails:
squiggle doctor ✔ iPhone: Maya’s iPhone (iPhone 16 Pro, iOS 26.1) is paired and unlocked ✔ Developer Mode: on ✔ device link: up (cable): Squiggle reaches the app and the runner through it, never over the LAN ✔ signing identity: Apple Development: maya@acme.com (A1B2C3D4E5), profile "iOS Team Provisioning Profile: *" (team 9XQ4ZK2LMB) signs the device runner ✔ dev build: com.acme.shop 2.4.0 is installed, built by this team ✔ device runner: installed, current and running: system alerts and sheets are read and tapped ✔ UI Automation: enabled (the runner is up) ✔ app agent: com.acme.shop carries the agent and answered over the device link (agent 7C1E0B42-5D9A-4F3B-9E61-2A8D4C0F7B13)device link says whether the phone is on a cable or on Wi-Fi. UI Automation can only be confirmed once the helper runs; before your first run, doctor says so instead.
What a phone can’t do
Squiggle refuses these on a phone and says why:
- Hardware buttons, Siri, simulated location, push notifications sent from the Mac, and granting or revoking privacy permissions from the Mac.
- Opening a URL in the app from outside it.
- Screenshots show your app’s own windows, without the status bar or keyboard. While an alert or sheet is up, a screenshot shows the whole screen.
- Driving a Release build. Only a Debug build carries the agent.
Keep the phone unlocked while Squiggle drives it: set Auto-Lock to Never.
Troubleshooting
| What you see | What to do |
|---|---|
… is locked: unlock it | Unlock the phone and keep it unlocked (Settings › Display & Brightness › Auto-Lock › Never), then run again. |
… device link is not up | Connect the phone by cable, or keep it on the same Wi-Fi as the Mac with both awake, and unlock it. |
the app’s agent on the iPhone did not answer | The installed build has no agent. Check that "@squiggle.sh/react-native" is in your plugins, then build a Debug build for the phone again. |
the device runner did not come up on the iPhone | Unlock the phone. If it shows a passcode prompt for UI Automation, enter it, then run again. |
no development profile on this Mac covers the device runner | Open your app in Xcode with automatic signing for a paid team and build it for the phone once. Xcode then keeps the team’s wildcard profile. |
profiles of 2 teams can sign the device runner | Set "team" under "device" in .squiggle/config.jsonc. |
no paired device is called …, or 2 iPhones are paired | Set "id" under "device" to the phone’s name, as xcrun devicectl list devices shows it. |
Two Squiggle dev builds on one phone can both want Metro’s port. The one in the foreground gets it; close the other app if a run waits on Metro.