【问题标题】:Travis: xcodebuild: error: Unable to find a destination matching the provided destination specifierTravis:xcodebuild:错误:找不到与提供的目标说明符匹配的目标
【发布时间】:2017-06-23 19:35:25
【问题描述】:

我正在尝试使用 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

我没有错误。你们中的任何人都知道为什么我会收到此错误吗?或者是否有任何解决此错误的方法?

非常感谢您的帮助。

【问题讨论】:

  • 您是否与xcrun instruments -w "iPhone 6s"xcrun instruments -w "*" 核对过可用的设备/模拟器以及您的设备/模拟器是否是其中之一?会不会是你的操作系统版本不匹配?
  • 您找出问题所在了吗?我遇到了同样的问题

标签: ios swift xcode8 travis-ci xcodebuild


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    我在使用 Xcode 9.4 创建的目标上遇到了类似的问题,并试图在使用 Xcode 9.3 的 travis 上运行。 Build Settings 中的 tvOS 部署目标是 11.4。我把它改回 11.1,然后 travis 开始工作了:

    --- a/GoogleUtilities/Example/GoogleUtilities.xcodeproj/project.pbxproj
    +++ b/GoogleUtilities/Example/GoogleUtilities.xcodeproj/project.pbxproj
    @@ -974,7 +974,7 @@
                                    PRODUCT_NAME = "$(TARGET_NAME)";
                                    SDKROOT = appletvos;
                                    TARGETED_DEVICE_FAMILY = 3;
    -                               TVOS_DEPLOYMENT_TARGET = 11.4;
    +                               TVOS_DEPLOYMENT_TARGET = 11.1;
                            };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-30
      • 2021-12-10
      • 1970-01-01
      • 2017-04-26
      • 2012-09-07
      • 2016-02-15
      • 2020-07-12
      • 2016-11-14
      相关资源
      最近更新 更多