首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用detox运行测试用例

无法使用detox运行测试用例
EN

Stack Overflow用户
提问于 2019-01-31 20:18:05
回答 2查看 1.2K关注 0票数 4

在使用detox运行测试用例时,我遇到了下面的错误。我已经安装了所有依赖项作为其中的一部分。

代码语言:javascript
复制
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)
EN

回答 2

Stack Overflow用户

发布于 2019-01-31 20:32:47

这是因为将package.jsondetox配置中的模拟器设置为系统上没有的模拟器

代码语言:javascript
复制
"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
      }
    },

您应该在终端中运行xcrun simctl list,以查看哪些模拟器可用。然后在您的detox配置中使用其中一个可用配置。您可以将其更改为"iPhone 7""iPhone 8"

票数 1
EN

Stack Overflow用户

发布于 2019-11-26 12:50:59

另一种可能的解决方案在这里

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

我们需要升级AppleSimUtils.如果您在升级check out here时遇到问题

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54460433

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档