Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcodebuild: error: Unable to find a destination matching the provided destination specifier: #7454

Closed
MartinP7r opened this issue Feb 24, 2018 · 13 comments

Comments

@MartinP7r
Copy link

MartinP7r commented Feb 24, 2018

Report

What did you do?

Run pod lib lint on a freshly created pod

What did you expect to happen?

usual warnings and a passing check

What happened instead?

following error message:

    - ERROR | xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | [iOS] xcodebuild:  xcodebuild: error: Unable to find a destination matching the provided destination specifier:

There is no actual specifier in the error message, so I'm thinking cocoapods doesn't provide xcodebuild with one. I do have the default set of simulators installed, checked with xcrun simctl list

== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone 8 (com.apple.CoreSimulator.SimDeviceType.iPhone-8)
iPhone 8 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPhone X (com.apple.CoreSimulator.SimDeviceType.iPhone-X)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad (5th generation) (com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
iPad Pro (12.9-inch) (2nd generation) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-)
iPad Pro (10.5-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-)
Apple TV (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple TV 4K (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K)
Apple TV 4K (at 1080p) (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
Apple Watch Series 3 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm)
Apple Watch Series 3 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm)
== Runtimes ==
iOS 11.2 (11.2 - 15C107) - com.apple.CoreSimulator.SimRuntime.iOS-11-2
tvOS 11.2 (11.2 - 15K104) - com.apple.CoreSimulator.SimRuntime.tvOS-11-2
watchOS 4.2 (4.2 - 15S100) - com.apple.CoreSimulator.SimRuntime.watchOS-4-2
== Devices ==
-- iOS 11.2 --
    iPhone 5s (6AC7A44D-6523-4371-AAAB-C5191451D58E) (Shutdown)
    iPhone 6 (885A290F-CB0D-4AEA-A268-272E80756E95) (Shutdown)
    iPhone 6 Plus (DA45B3D4-B021-4C59-8595-D6CC0386E3E3) (Shutdown)
    iPhone 6s (4C467F31-9193-4AE2-B12B-11E61943FC99) (Shutdown)
    iPhone 6s Plus (04763E0E-0887-4998-9A9B-CB5EA903582B) (Shutdown)
    iPhone 7 (730D0B4A-65C7-40C2-8BF9-F42114FFA41A) (Shutdown)
    iPhone 7 Plus (601F0F70-72BF-4E3C-B7C4-CB0D93CD8DCB) (Shutdown)
    iPhone 8 (E6EF973F-2470-4644-875F-6D2422764F60) (Shutdown)
    iPhone 8 Plus (3C50694A-55A2-42F4-B2D2-06A0F29B8C2D) (Shutdown)
    iPhone SE (9C15AC46-816E-4A85-9F21-A693CE34D542) (Booted)
    test (D770A38F-C6D9-4F51-8ADA-A2EAB7809CCC) (Shutdown)
    iPhone X (626866A7-B843-4CCF-B27D-00420F5F16DB) (Shutdown)
    iPad Air (F1A4D745-D7A1-466A-893A-277E8C63A42E) (Shutdown)
    iPad Air 2 (350F97EF-634B-41A1-BBBB-A973730C1DBC) (Shutdown)
    iPad (5th generation) (5295B130-CC99-4584-AC5C-C1737EFD06B7) (Shutdown)
    iPad Pro (9.7-inch) (263339B6-4D37-462D-ABB4-41BC2E460C71) (Shutdown)
    iPad Pro (12.9-inch) (8B8AB8CD-9568-477A-A674-7EB94C0374AD) (Shutdown)
    iPad Pro (12.9-inch) (2nd generation) (A4CCB97C-83D3-468B-AF65-8635BD08FE7D) (Shutdown)
    iPad Pro (10.5-inch) (8F31BF0B-8A36-4DCE-A73E-4E975240F884) (Shutdown)
-- tvOS 11.2 --
    Apple TV (C0071D15-E566-4211-9015-A1921DEC8ED9) (Shutdown)
    Apple TV 4K (F6A3F47E-42D3-4260-9485-9A583E8B0806) (Shutdown)
    Apple TV 4K (at 1080p) (70E80ED7-2C77-4151-8FF2-218F9C087FEB) (Shutdown)
-- watchOS 4.2 --
    Apple Watch - 38mm (D7FAF32D-D35C-4258-A3BE-CCEB7CC4F1A5) (Shutdown)
    Apple Watch - 42mm (1E707417-E9D4-47D6-9567-3EB3A4398CB2) (Shutdown)
    Apple Watch Series 2 - 38mm (CA0DD4A2-A03C-4B65-85BF-B329929BCFDC) (Shutdown)
    Apple Watch Series 2 - 42mm (A3D58728-B26A-415A-B82B-AF0F4B5D5C49) (Shutdown)
    Apple Watch Series 3 - 38mm (AF04DA7E-32B4-4484-8C31-AE50AE0962DD) (Shutdown)
    Apple Watch Series 3 - 42mm (62AC89B9-E8E5-4CBF-9AFA-514AC3BD8105) (Shutdown)
== Device Pairs ==
938AB909-0950-473C-8030-21CFE0F12AB3 (active, disconnected)
    Watch: Apple Watch Series 2 - 38mm (CA0DD4A2-A03C-4B65-85BF-B329929BCFDC) (Shutdown)
    Phone: iPhone 7 (730D0B4A-65C7-40C2-8BF9-F42114FFA41A) (Shutdown)
83F2DE11-004F-4975-BCD1-6E2140C4AF83 (active, disconnected)
    Watch: Apple Watch Series 2 - 42mm (A3D58728-B26A-415A-B82B-AF0F4B5D5C49) (Shutdown)
    Phone: iPhone 7 Plus (601F0F70-72BF-4E3C-B7C4-CB0D93CD8DCB) (Shutdown)
521265EE-7B6B-40FC-802D-C15C781ECCD3 (active, disconnected)
    Watch: Apple Watch Series 3 - 38mm (AF04DA7E-32B4-4484-8C31-AE50AE0962DD) (Shutdown)
    Phone: iPhone 8 (E6EF973F-2470-4644-875F-6D2422764F60) (Shutdown)
5FEFB912-189D-4643-9D06-101C50147A0F (active, disconnected)
    Watch: Apple Watch Series 3 - 42mm (62AC89B9-E8E5-4CBF-9AFA-514AC3BD8105) (Shutdown)
    Phone: iPhone 8 Plus (3C50694A-55A2-42F4-B2D2-06A0F29B8C2D) (Shutdown)

CocoaPods Environment

Stack

   CocoaPods : 1.4.0
        Ruby : ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
    RubyGems : 2.7.4
        Host : Mac OS X 10.13.3 (17D102)
       Xcode : 9.2 (9C40b)
         Git : git version 2.16.1
Ruby lib dir : /usr/local/Cellar/ruby/2.5.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 8ab2e8da5c6bc8a9041a0e237e8acb29b589a61c

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Project that demonstrates the issue

happens with any pod lib I try to create

@dnkoutso
Copy link
Contributor

Seems like a simulator is missing from your setup to execute the build. I do not think this is a cocoapods issue.

@MartinP7r
Copy link
Author

There are lots of simulators installed as shown in the output of xcrun simctl list. how do I find out which one is needed if there is no output after identifier: in the error message?

@dnkoutso
Copy link
Contributor

Have you tried --verbose? Also the best way to debug this is to attempt and edit your cocoapods sources unfortunately and in particular the file validator.rb.

It will be very hard for me to debug with the current info as it definitely seems some specific configuration issue on your machine.

Definitely not ruling out an actual CocoaPods bug that we can fix or make better :)

@MartinP7r
Copy link
Author

MartinP7r commented Feb 25, 2018

Thanks, so I was trying around a bit.

$ pod lib lint --verbose --no-clean

    testpod2 (0.1.0) - Analyzing on iOS 11.0 platform.
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-App`: (``)

(... omitted ...)

-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
   Building with xcodebuild.
xcodebuild clean build -workspace /var/folders/_2/tlhb_qcd7sb335ydqpp7_73h0000gn/T/CocoaPods-Lint-20180225-10208-1vwh8so-testpod2/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=6AC7A44D-6523-4371-AAAB-C5191451D58E
Build settings from command line:
    CODE_SIGN_IDENTITY = -
    SDKROOT = iphonesimulator11.2

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
		{ id:6AC7A44D-6523-4371-AAAB-C5191451D58E }

	Available destinations for the "App" scheme:
		{ platform:iOS Simulator, id:9C15AC46-816E-4A85-9F21-A693CE34D542, OS:11.2, name:iPhone SE }
		{ platform:iOS Simulator, id:626866A7-B843-4CCF-B27D-00420F5F16DB, OS:11.2, name:iPhone X }

	Ineligible destinations for the "App" scheme:
		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
		{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
   Testing with xcodebuild.
 -> testpod2 (0.1.0)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | [iOS] xcodebuild:  xcodebuild: error: Unable to find a destination matching the provided destination specifier:

while running it then without the destination parameter works perfectly fine:

$ xcodebuild clean build -workspace /var/folders/_2/tlhb_qcd7sb335ydqpp7_73h0000gn/T/CocoaPods-Lint-20180225-9820-1a71z0z-testpod2/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator
(... omitted ...)
** BUILD SUCCEEDED **

the funny thing is, the device in question ins showing up in xcrun simctl list as well as instruments -s devices

$ instruments -s devices                                                         
Known Devices:
Apple TV (11.2) [C0071D15-E566-4211-9015-A1921DEC8ED9] (Simulator)
Apple TV 4K (11.2) [F6A3F47E-42D3-4260-9485-9A583E8B0806] (Simulator)
Apple TV 4K (at 1080p) (11.2) [70E80ED7-2C77-4151-8FF2-218F9C087FEB] (Simulator)
Apple Watch - 38mm (4.2) [D7FAF32D-D35C-4258-A3BE-CCEB7CC4F1A5] (Simulator)
Apple Watch - 42mm (4.2) [1E707417-E9D4-47D6-9567-3EB3A4398CB2] (Simulator)
iPad (5th generation) (11.2) [5295B130-CC99-4584-AC5C-C1737EFD06B7] (Simulator)
iPad Air (11.2) [F1A4D745-D7A1-466A-893A-277E8C63A42E] (Simulator)
iPad Air 2 (11.2) [350F97EF-634B-41A1-BBBB-A973730C1DBC] (Simulator)
iPad Pro (10.5-inch) (11.2) [8F31BF0B-8A36-4DCE-A73E-4E975240F884] (Simulator)
iPad Pro (12.9-inch) (11.2) [8B8AB8CD-9568-477A-A674-7EB94C0374AD] (Simulator)
iPad Pro (12.9-inch) (2nd generation) (11.2) [A4CCB97C-83D3-468B-AF65-8635BD08FE7D] (Simulator)
iPad Pro (9.7-inch) (11.2) [263339B6-4D37-462D-ABB4-41BC2E460C71] (Simulator)
iPhone 5s (11.2) [6AC7A44D-6523-4371-AAAB-C5191451D58E] (Simulator)
iPhone 6 (11.2) [885A290F-CB0D-4AEA-A268-272E80756E95] (Simulator)
iPhone 6 Plus (11.2) [DA45B3D4-B021-4C59-8595-D6CC0386E3E3] (Simulator)
iPhone 6s (11.2) [4C467F31-9193-4AE2-B12B-11E61943FC99] (Simulator)
iPhone 6s Plus (11.2) [04763E0E-0887-4998-9A9B-CB5EA903582B] (Simulator)
iPhone 7 (11.2) [730D0B4A-65C7-40C2-8BF9-F42114FFA41A] (Simulator)
iPhone 7 (11.2) + Apple Watch Series 2 - 38mm (4.2) [CA0DD4A2-A03C-4B65-85BF-B329929BCFDC] (Simulator)
iPhone 7 Plus (11.2) [601F0F70-72BF-4E3C-B7C4-CB0D93CD8DCB] (Simulator)
iPhone 7 Plus (11.2) + Apple Watch Series 2 - 42mm (4.2) [A3D58728-B26A-415A-B82B-AF0F4B5D5C49] (Simulator)
iPhone 8 (11.2) [E6EF973F-2470-4644-875F-6D2422764F60] (Simulator)
iPhone 8 (11.2) + Apple Watch Series 3 - 38mm (4.2) [AF04DA7E-32B4-4484-8C31-AE50AE0962DD] (Simulator)
iPhone 8 Plus (11.2) [3C50694A-55A2-42F4-B2D2-06A0F29B8C2D] (Simulator)
iPhone 8 Plus (11.2) + Apple Watch Series 3 - 42mm (4.2) [62AC89B9-E8E5-4CBF-9AFA-514AC3BD8105] (Simulator)
iPhone SE (11.2) [9C15AC46-816E-4A85-9F21-A693CE34D542] (Simulator)
iPhone X (11.2) [626866A7-B843-4CCF-B27D-00420F5F16DB] (Simulator)

I remember that I once removed the check-marks in Xcode->Window->Devices->Simulators for all devices but iphone SE and iphone X. so i tried re-checking them, but the xcodebuild error and available devices stayed the same.
So what I tried then, was to delete simulator devices until the top device listed in xcrun simctl list was iPhone SE, being the first one of the available devices shown in the xcodebuild error and low and behold, pod lib lint passed.

$ pod lib lint      

 -> testpod2 (0.1.0)

testpod2 passed validation.

So, you are probably right, that there is something wrong with my setup.
Additionally I'd like to ask why the lint command has to pass a destination id to xcodebuild while it seems to work perfectly fine with only the -sdk iphonesimulator parameter

@dnkoutso
Copy link
Contributor

Actually uncertain to me for the last question and part.

It predates me. I am going to close this issue, but please do let me know if there is an issue here we can consider making better with CocoaPods

@tsomaev
Copy link

tsomaev commented Mar 6, 2018

@cyrus86 hi man, did you solved this problem ?

@MartinP7r
Copy link
Author

@Tawfikk not directly, no. I used kind of a hacky workaround as described in my post above.
I deleted iPhone devices from my xcrun simctl list until the first device in the list matched the first device in Available destinations from the error output. That's when pod lib lint stopped complaining.

@tsomaev
Copy link

tsomaev commented Mar 7, 2018

@cyrus86 THANKS for the tip. I also deleted all iOS devices and add the new iPhone se, and it's allowed pass validate my repo.

@paulb777
Copy link
Member

I had the problem with tvOS and had to delete two 11.2 tvOS simulators, leaving only the two 11.4 tvOS simulators. Thanks @cyrus86

@fitsyu
Copy link

fitsyu commented Jun 11, 2019

  1. I met this problem and solved without deleting any simulator by opening validator.rb and commented out the line 986 which sets destination-id arg
    #command += Fourflusher::SimControl.new.destination(:oldest, 'iOS', deployment_target)
    it is silly, but it'll give a quick peace of mind for fellow sufferer.

@bacc3
Copy link

bacc3 commented Jul 13, 2020

I'm fixing this problem by removing all simulators which were not marked "Show as run destination"

  1. Open XCode
  2. Select "Window" bar -> Devices and Simulators
  3. Go through the list of simulators and delete those that do not have "Show as run destination" mark

@moisesolmedo-okta
Copy link

Anyone found a workaround for this without deleting simulators? I'm getting this issue on Xcode 14, seems it's an issue with Fourflusher.

@dsrees
Copy link

dsrees commented Apr 13, 2023

I was receiving this error as well despite having all of my simulators up to date and present. Turns out the version of Cocoapods I was running didn't support the latest devices. Updating to 1.12.0 resolved the issue

2023-04-12 15:05:51.960 xcodebuild[24090:5090687] Writing error result bundle to /var/folders/8t/99l7cqps2s16g9bxh7hvwy1r0000gn/T/ResultBundle_2023-12-04_15-05-0051.xcresult
    xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    		{ id:97989121-6BA1-4E03-9244-627FBC81CBDF }

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

    	Available destinations for the "App" scheme:
    		{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }
    		{ platform:watchOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-watchsimulator:placeholder, name:Any watchOS Simulator Device }
    		{ platform:watchOS Simulator, id:97989121-6BA1-4E03-9244-627FBC81CBDF, OS:9.1, name:Apple Watch SE (40mm) (2nd generation) }
    		{ platform:watchOS Simulator, id:3C903553-2471-4952-8AA2-D3454A56DD88, OS:9.1, name:Apple Watch SE (44mm) (2nd generation) }
    		...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants