Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find a destination matching the provided destination specifier

Currently, I am struggling with the following issue and it's kind of big blocker for our project. We need to run ui tests for apple watch test target in the iOS App with Watch App using terminal and we receive such error, which is quite frustrating

Command I use:

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

xcodebuild: error: Unable to find a destination matching the provided 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 }

Destination is iPhone's simulator id which is paired with apple watch

Has anyone faced such issue?

like image 818
zhanch Avatar asked Oct 25 '25 05:10

zhanch


1 Answers

So, after a long investigation and a long list of possible fixes that resolved nothing, I updated Xcode and tried to run the same command, which didn't work either and only after creating new clean project using new Xcode it finally worked.

I used:

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' 

It worked for me on the simulators, didn't try it on real device yet

Interesting fact: I am still able to see this error in some case, especially when I don't specify platform in the 'destination'

like image 180
zhanch Avatar answered Oct 26 '25 20:10

zhanch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!