作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试使用 travis-ci.org 实现持续集成。
这是我当前的 .travis.yml 配置:
language: swift
osx_image: xcode8.3.3
xcode_project: AutomatediOSBuild.xcodeproj #3
xcode_scheme: Debug
#xcode_sdk: iphonesimulator10.0
script:
- xcodebuild -scheme AutomatediOSBuild -project AutomatediOSBuild.xcodeproj -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.3.1' build test
但我在 travis 上遇到以下错误:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:10.3.1, name:iPhone 6s }
The requested device could not be found because no available devices matched the request.
The command "xcodebuild -scheme myProject -project myProject.xcodeproj -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.3.1' build test" exited with 70.
如果我在命令行中运行:
xcodebuild -scheme myProject -project myProject.xcodeproj -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.3.1' build test
我没有错误。你们中有人知道为什么我会收到此错误吗?或者是否有解决此错误的方法?
非常感谢您的帮助。
最佳答案
xcodebuild 的 Travis 环境可能与您的不同,即您在本地拥有与您的 -destination
选项相对应的正确模拟器,但您的 Travis-ci 容器没有。
作业日志应该为您提供更多信息,例如:
The requested device could not be found because no available devices matched the request.
585
586 Available destinations for the "stackoverflow" scheme:
587 { platform:iOS Simulator, id:5B...65, OS:13.2.2, name:iPad (7th generation) }
588 { platform:iOS Simulator, id:1A...DA, OS:13.2.2, name:iPhone 8 }
Travis 在 documentation 上列出了所选 osx_image
的可用模拟器,还有这个 mokacoding post给出了很好的解释。
我还发现您必须提供确切的操作系统版本,例如在我上面的例子中:
xcode_destination: platform=iOS Simulator,name=iPhone 8,OS=13.2 # fails
xcode_destination: platform=iOS Simulator,name=iPhone 8,OS=13.2.2 # works
关于ios - 特拉维斯 : xcodebuild: error: Unable to find a destination matching the provided destination specifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44728782/
我是一名优秀的程序员,十分优秀!