无法找到与所提供的目的地说明符匹配的目的地



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

我使用的命令:

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

xcodebuild: error: Unable to find a destination specifier{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 }

目的地是与apple watch配对的iPhone模拟器id

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

所以,经过长时间的调查和一长串可能的修复,没有解决任何问题,我更新了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' 

它在模拟器上为我工作,还没有在真正的设备上尝试过

有趣的事实:在某些情况下,我仍然可以看到这个错误,特别是当我没有在'destination'

中指定平台时。

最新更新