![](/img/trans.png)
[英]Travis: xcodebuild: error: Unable to find a destination matching the provided destination specifier
[英]Unable to find a destination matching the provided destination specifier
目前,我正在努力解決以下問題,這是我們項目的一大障礙。 我們需要在 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 是 iPhone 的模擬器 id,它與 Apple Watch 配對
有沒有人遇到過這樣的問題?
因此,經過長時間的調查和一長串沒有解決任何問題的可能修復程序,我更新了 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'
它在模擬器上對我有用,還沒有在真實設備上嘗試過
有趣的事實:在某些情況下,我仍然能夠看到此錯誤,尤其是當我沒有在“目的地”中指定平台時
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.