4

enter image description here

I am facing the error below when running test case using detox. I had all dependencies installed as part of it.

Can't find a simulator to match with " iPhone 6 ", run 'xcrun simctl list' to list your supported devices.

configuration="ios.sim.debug" artifactsLocation="artifacts/ios.sim.debug.2019-01-31 12-14-41Z" node_modules/.bin/jest "e2e" --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$' 
detox[5864] INFO:  [DetoxServer.js] server listening on localhost:57598...
detox[5864] ERROR: [index.js/DETOX_INIT_ERROR] 
 Error: Can't find a simulator to match with " iPhone 6 ", run 'xcrun simctl list' to list your supported devices.
      It is advised to only state a device type, and not to state iOS version, e.g. "iPhone 7"
    at AppleSimUtils.findDevicesUDID (/Users/alok/Desktop/malliswari/accordion/node_modules/detox/src/devices/ios/AppleSimUtils.js:46:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Andrew
  • 26,706
  • 9
  • 85
  • 101
user3463349
  • 127
  • 3
  • 11
  • You shouldn't post errors as images, you should copy the error message and paste it. Please copy and paste the **whole** error message. – Andrew Feb 01 '19 at 09:19

2 Answers2

2

This is caused by setting the simulator in your detox config in your package.json to one that isn't on your system

"detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/myapp.app",
        "build": "RN_SRC_EXT=e2e.js xcodebuild -workspace ios/myapp.xcworkspace -scheme myapp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone 7" // <- this is where you define your simulator
      }
    },

You should run xcrun simctl list in your terminal to see which simulators are available. Then use one of the available ones in your detox configuration. Chances are you should be able to change it to "iPhone 7" or "iPhone 8"

Andrew
  • 26,706
  • 9
  • 85
  • 101
  • Iam using iPhone X as simulator and updated package.json as per it. – user3463349 Jan 31 '19 at 17:26
  • }, "detox": { "configurations": { "ios.sim.debug": { "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/detoxtest.app", "build": "xcodebuild -project ios/detoxtest.xcodeproj -scheme detoxtest -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build", "type": "ios.simulator", "name": "iPhone X" } }, "test-runner": "jest" } } – user3463349 Jan 31 '19 at 17:32
  • Facing below error .Detox[28802] ERROR: [exec.js/EXEC_FAIL, #6] /bin/sh: /Users/alok/Library/Developer/CoreSimulator/Devices/3C26850F-B9D1-48D2-9491-224F76C0E69A/data/tmp/detox.last_launch_app_log.out: No such file or directory – user3463349 Jan 31 '19 at 17:32
  • Delete the `ios/build` folder and rebuild with detox using `detox build -c ios.sim.debug && detox test -c ios.sim.debug'` – Andrew Jan 31 '19 at 17:39
  • Still facing the same issue. Can you please help me out. – user3463349 Feb 01 '19 at 05:02
  • detox[13066] INFO: [DetoxServer.js] server listening on localhost:55143... FAIL e2e/firstTest.spec.js Example ✕ should have welcome screen (2ms) ● Example › should have welcome screen ChildProcessError: Command failed: /bin/cat /dev/null >/Users/alok/Library/Developer/CoreSimulator/Devices/3C26850F-B9D1-48D2-9491-224F76C0E69A/data/tmp/detox.last_launch_app_log.out 2>/Users/alok/Library/Developer/CoreSimulator/Devices/3C26850F-B9D1-48D2-9491-224F76C0E69A/data/tmp/detox.last_launch_app_log.err && – user3463349 Feb 01 '19 at 05:10
  • You need to post your **full** error in your question. Comments are not the place for error messages as they are unformatted, difficult to read and usually truncated. – Andrew Feb 01 '19 at 06:52
  • Example › should have welcome screen ReferenceError: device is not defined 2 | beforeEach(async () => { 3 | > 4 | await device.reloadReactNative(); | ^ 5 | }); 6 | 7 | it('should have welcome screen', async () => { at Object.device (firstTest.spec.js:4:11) at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:62:40) – user3463349 Feb 01 '19 at 09:37
  • detox[22383] ERROR: [exec.js/EXEC_FAIL, #6] "/bin/cat /dev/null >/Users/alok/Library/Developer/CoreSimulator/Devices/3C26850F-B9D1-48D2-9491-224F76C0E69A/data/tmp/detox.last_launch_app_log.out 2>/Users/alok/Library/Developer/CoreSimulator/Devices/3C26850F-B9D1-48D2-9491-224F76C0E69A/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/alok/Library/Detox/ios/97c1dcc1b30ebf51053e43d2bc79fd6e2e3018d1/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err – user3463349 Feb 01 '19 at 09:38
  • 3
    Seriously I cannot help if you keep posting the error in the comments, You need to post it in the question, and it needs to be all of it – Andrew Feb 01 '19 at 09:40
1

Another possible solution is here

https://github.com/wix/Detox/issues/1103

We need to upgrade AppleSimUtils. In case if you have issues in upgrading check out here

Narasimha Reddy - Geeker
  • 3,510
  • 2
  • 18
  • 23