【问题标题】:Unable to find a destination matching the provided destination specifier找不到与提供的目的地说明符匹配的目的地
【发布时间】:2021-12-10 23:48:14
【问题描述】:

目前,我正在努力解决以下问题,这对我们的项目来说是一个很大的障碍。 我们需要使用终端在 iOS 应用中使用 Watch App 对 Apple Watch 测试目标运行 ui 测试,我们收到这样的错误,这非常令人沮丧

我使用的命令:

xcodebuild test -workspace WatchTesterApp.xcworkspace -scheme 'Watch' -destination 'id=F35DCC98-0F7D-460E-A49F-A446FD5FB4BE'

xcodebuild:错误:无法找到与提供的目标说明符匹配的目标: { id:F35DCC98-0F7D-460E-A49F-A446FD5FB4BE }

The requested device could not be found because no available devices matched the request.

Available destinations for the "Watch" scheme:
    { platform:iOS Simulator, id:F35DCC98-0F7D-460E-A49F-A446FD5FB4BE, OS:14.5, name:iPhone 12 Pro }

Ineligible destinations for the "Watch" scheme:
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    { platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }

Destination 是与 Apple Watch 配对的 iPhone 模拟器 ID

有人遇到过这样的问题吗?

【问题讨论】:

    标签: ios terminal xcode-ui-testing watchos uitest


    【解决方案1】:

    因此,经过长时间的调查和一长串可能的修复程序但没有解决任何问题,我更新了 Xcode 并尝试运行相同的命令,但它也没有工作,只有在使用新的 Xcode 创建新的干净项目后它才最终工作.

    我用过:

    xcodebuild test -workspace WatchTesterAppExample.xcworkspace -scheme 'WatchTesterAppExample WatchKit App' -destination 'platform=WatchOS Simulator,name=Apple Watch Series 7 - 45mm' & 
    xcodebuild test -workspace WatchTesterAppExample.xcworkspace -scheme 'WatchTesterAppExample' -destination 'platform=iOS Simulator,name=iPhone 13' 
    

    它在模拟器上对我有用,还没有在真实设备上尝试过

    有趣的事实:在某些情况下我仍然可以看到这个错误,尤其是当我没有在“目标”中指定平台时

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多