Running project on iOS simulator

Please provide the following:

  1. SDK Version: 3.27.10
    Node: 12.18.4
    Xcode: 12.0
  2. Platforms(Android/iOS/web/all): iOS

I’m having issues getting a new project to launch on an iOS simulator with the i command. I am also unable to install the expo app onto the simulator using

expo client:install:ios

I have tried switching node versions (12.13.0, 12.14.1, 12.18.4), uninstalling and reinstalling the expo-cli package via npm, creating another blank project with expo init, but no luck.

Error trying to run iOS app on simulator:

(node:30723) UnhandledPromiseRejectionWarning: Error: xcrun exited with non-zero code: 4
    at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
    at xcrunAsync (/@expo/xdl@58.0.9/src/SimControl.ts:323:18)
    at Object.bootAsync (/@expo/xdl@58.0.9/src/SimControl.ts:137:11)
    at action (/@expo/xdl@58.0.9/src/Simulator.ts:310:25)
    at waitForActionAsync (/@expo/xdl@58.0.9/src/Simulator.ts:292:22)
    at ensureSimulatorOpenAsync (/@expo/xdl@58.0.9/src/Simulator.ts:207:24)
    at Object.openProjectAsync (/@expo/xdl@58.0.9/src/Simulator.ts:641:14)
    at ReadStream.handleKeypress (/usr/local/lib/node_modules/expo-cli/src/commands/start/TerminalUI.ts:246:11)
(node:30723) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
(node:30723) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error trying to install expo client on simulator:

Error: xcrun exited with non-zero code: 4
    at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
    at xcrunAsync (/@expo/xdl@58.0.9/src/SimControl.ts:323:18)
    at Object.bootAsync (/@expo/xdl@58.0.9/src/SimControl.ts:137:11)
    at action (/@expo/xdl@58.0.9/src/Simulator.ts:310:25)
    at waitForActionAsync (/@expo/xdl@58.0.9/src/Simulator.ts:292:22)
    at ensureSimulatorOpenAsync (/@expo/xdl@58.0.9/src/Simulator.ts:207:24)
    at Object.upgradeExpoAsync (/@expo/xdl@58.0.9/src/Simulator.ts:504:21)
    at /usr/local/lib/node_modules/expo-cli/src/commands/client/index.ts:321:11
    at Command.<anonymous> (/usr/local/lib/node_modules/expo-cli/src/exp.ts:302:7)

Both errors seem to point to an unhandled promise in the expo-cli global package at

@expo/spawn-async/src/spawnAsync.ts:65:13

Thank you for your help!

This happened to me today also, tried googling but no luck. I’ve upgraded expo SDK to latest version (39) and it seems to be working now.

try starting the simulator beforehand. usually when xcrun fails it is because something is wrong with the simulator process on your machine. you can try also try reseting the state of your simulator entirely by opening it and choosing this from the toolbar:
Screen Shot 2020-10-04 at 9.45.38 PM

1 Like

Thanks for your response!

I have tried the “Erase All Content and Settings…” as well as using different iOS versions (12 and 14) but the same error is persisting. I have also confirmed that the Expo SDK is up to date.

Connecting to the Expo project with my physical device running iOS 14 is working.

I got the same issue today (simulator didn’t started even manually).

Solved by first upgrading xcode, then running

sudo xcode-select --reset

and then I opened Xcode manually once.

I tried before some other things, notably xcrun simctl erase all which delete all devices contents. It may be necessary in combination of the above trick as well.

I must add that the things started to go bad when I manually deleted cache directories of xcode… to leave enough space to download the update :wink:

1 Like