gpt4 book ai didi

react-native - 无法使用 detox 运行测试用例

转载 作者:行者123 更新时间:2023-12-04 05:11:36 30 4
gpt4 key购买 nike

enter image description here

使用 detox 运行测试用例时,我面临以下错误。
我安装了所有依赖项作为它的一部分。

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)

最佳答案

这是由在您的 detox 中设置模拟器引起的。在您的 package.json 中配置到一个不在你系统上的

"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"

关于react-native - 无法使用 detox 运行测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54460433/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com