Hello community!
Recently I faced unusual problem when I'm trying to run UITest from commandline. Everything works from XCode (I can execute UITest on both simulator and device), but in console I'm always getting:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:17.5, name:iPhone 15 Pro }
I already checked lot of possible solutions but none worked. What seems to be important here, I don't have any "Available destinations" proposal. Also installed XCode version is 16, but I need to run this project on 15.4 which is in another folder (I used xcode-select to choose 15.4, also tried to execute xcodebuild using full path) .
Executing:
xcrun simctl list
shows me f.e.:
-- iOS 17.5 --
iPhone 13 Pro (D20DE861-B938-4FD3-9797-F0AE0BBA5569) (Shutdown)
iPhone 15 (FE8687E4-B7CD-4861-83F8-B9E833F14982) (Shutdown)
iPhone 15 Plus (4B1F46CC-7C95-496B-9776-EC6BC539199E) (Shutdown)
iPhone 15 Pro (C622866E-74C8-45F5-A7B0-DFA76BC7C452) (Booted)
iPhone 15 Pro Max (CEF3892C-CFD4-4558-A317-A6EBDB079AAF) (Shutdown)
but running:
xcodebuild -workspace ./***.xcworkspace -scheme xxxUITests -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' build
brings same error. What is also interesting, I'm getting same error when trying to run same command in GitLab pipeline. Is there anyone who had same problem?