user3463349
user3463349

Reputation: 127

Unable to run test case using detox

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)

Upvotes: 4

Views: 1946

Answers (2)

Narasimha Reddy - Geeker
Narasimha Reddy - Geeker

Reputation: 3870

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

Upvotes: 1

Andrew
Andrew

Reputation: 28539

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"

Upvotes: 2

Related Questions