xcode – xcodebuild error: Unable to find a destination generic iOS Simulator

0
84

[ad_1]

I am having a framework that I am building using a buildscript using xcodebuild.
The framework archives for all architectures required so that it can be used in another Xcode project.

However, since I have installed Xcode 14, the build script gives an error when I am building for iOS Simulator. I do need to build the framework for iOS simulator as well so that developers can test their app that use the framwework on an iOS simulator.

The command line to archive the framework for iOS Simulator is:

xcodebuild archive -scheme <TargetName> -destination 'generic/platform=iOS Simulator'     -archivePath <ArchivePath> SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

The error I am getting is:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    { generic:1, platform:iOS Simulator }

This works well for all other destinations I am building the framework for (watchOS, iOS, watchOS Simulator), just not for iOS Simulator

In the output of xcodebuild is shows the available platforms.
Among all the specific Simulators that are available, it also has a ‘generic’ entry for the ‘watchOS Simulator’ destination:

{ platform:watchOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-watchsimulator:placeholder, name:Any watchOS Simulator Device  

An equivalent entry is not available in the list for ‘iOS Simulator’ as you can see in the output of xcodebuild below.
Is this the problem I am facing and should there be a similar ‘Any iOS Simulator Device’ entry in this list?

And if this is the problem, how can I add a generic ‘iOS Simulator’?
If not, what could be the problem instead?

For complete information, this is the full output of the xcodebuild command:

Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild archive -scheme <SCHEME> -destination "generic/platform=iOS Simulator" -archivePath Archiver/<archive-name>.xcarchive SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

User defaults from command line:
IDEArchivePathOverride = /<directory>/<archive-name>.xcarchive
IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
BUILD_LIBRARIES_FOR_DISTRIBUTION = YES
SKIP_INSTALL = NO

2022-10-03 16:18:52.358 xcodebuild[17449:3179785] Writing error result bundle to /var/folders/lj/n7mj7ccd3dd4fds0x_0jh0w00000gn/T/ResultBundle_2022-03-10_16-18-0052.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    { generic:1, platform:iOS Simulator }

Available destinations for the <scheme-name> scheme:
    { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:41E4E96D-C631-58DB-8E17-3556BF095CE6 }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    { platform:macOS, variant:Mac Catalyst, name:Any Mac }
    { 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:8B93893B-58A9-4BD5-BC84-D78DF46E3737, OS:8.5, name:38mm }
    { platform:watchOS Simulator, id:9A39430C-1550-4B53-8665-B3E8E3DD437C, OS:7.0, name:AWSE 40mm 7.0 }
    { platform:watchOS Simulator, id:85EAEDB9-281C-4C42-BB07-D381344B4F01, OS:9.0, name:Apple Watch SE (44mm) (2nd generation) }
    { platform:watchOS Simulator, id:7B667533-D65F-4206-A077-2D58CF319030, OS:7.0, name:Apple Watch Series 3 - 38mm }
    { platform:watchOS Simulator, id:2F0A6761-237E-46FE-B44B-FA5E11FD4A21, OS:7.0, name:Apple Watch Series 3 - 42mm }
    { platform:watchOS Simulator, id:EFEEDC25-E85E-4168-B6F3-96F8298A8E6E, OS:7.0, name:Apple Watch Series 4 - 40mm }
    { platform:watchOS Simulator, id:1525C7D5-CF81-47EA-8D4F-9B26AFB66BF8, OS:7.0, name:Apple Watch Series 4 - 44mm }
    { platform:watchOS Simulator, id:56F2E561-28F1-442D-BEB9-ED1877717760, OS:7.0, name:Apple Watch Series 4 - 44mm }
    { platform:watchOS Simulator, id:A8C716BF-F1D3-4516-BB49-5E91363DBB5F, OS:7.0, name:Apple Watch Series 5 - 40mm }
    { platform:watchOS Simulator, id:0656A4DC-9185-45D6-AE1C-17FAD1B1D0A7, OS:8.5, name:Apple Watch Series 5 - 40mm }
    { platform:watchOS Simulator, id:698CCD93-B788-4DDA-90AC-07661A9629B6, OS:9.0, name:Apple Watch Series 5 - 40mm }
    { platform:watchOS Simulator, id:730D0366-0323-4F3F-996A-561FC0E9AAFC, OS:7.0, name:Apple Watch Series 5 - 44mm }
    { platform:watchOS Simulator, id:3023177A-19DD-4F96-A73E-197259BC272C, OS:8.5, name:Apple Watch Series 5 - 44mm }
    { platform:watchOS Simulator, id:11510526-D5DC-434C-A90B-3BBC200CF8FB, OS:9.0, name:Apple Watch Series 5 - 44mm }
    { platform:watchOS Simulator, id:754F83EC-91F0-4256-B8E1-0D3C61BA7FF8, OS:8.5, name:Apple Watch Series 6 - 40mm }
    { platform:watchOS Simulator, id:13A6B166-22FF-438A-812A-B6950C75F962, OS:9.0, name:Apple Watch Series 6 - 40mm }
    { platform:watchOS Simulator, id:0C669787-AE31-4A05-AA8C-EED110A2263A, OS:8.5, name:Apple Watch Series 6 - 44mm }
    { platform:watchOS Simulator, id:A08AFD03-D2A2-4174-BEE1-86251CE83B5A, OS:9.0, name:Apple Watch Series 6 - 44mm }
    { platform:watchOS Simulator, id:84E1B07A-C242-40A3-AD7A-3B71149261A8, OS:8.5, name:Apple Watch Series 7 - 41mm }
    { platform:watchOS Simulator, id:D5774F1B-7970-45E8-AEE1-966BD0230D94, OS:9.0, name:Apple Watch Series 7 - 41mm }
    { platform:watchOS Simulator, id:6F1E4CFD-E60B-4BA0-BDB9-CB7B3C27CBD2, OS:8.5, name:Apple Watch Series 7 - 45mm }
    { platform:watchOS Simulator, id:5D127481-A881-4702-825C-AD30F6E70985, OS:9.0, name:Apple Watch Series 7 - 45mm }
    { platform:watchOS Simulator, id:2162F742-53DB-4DC1-8E99-DC3008123038, OS:9.0, name:Apple Watch Series 8 (41mm) }
    { platform:watchOS Simulator, id:9DE0C9A0-AEF3-49DB-BA48-F4E3CF0A6192, OS:9.0, name:Apple Watch Series 8 (45mm) }
    { platform:watchOS Simulator, id:5B5B40C5-2161-48FF-8042-F5035079BA2C, OS:9.0, name:Apple Watch Ultra (49mm) }
    { platform:iOS Simulator, id:46D15E87-293B-4180-BC8E-C9B3C791486E, OS:16.0, name:iPhone 8 }
    { platform:iOS Simulator, id:8EBBAB0A-67C8-4B7C-BED3-00CF2E3DEB29, OS:16.0, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:86F72120-9578-494B-A2B8-8307A3B60992, OS:16.0, name:iPhone 11 }
    { platform:iOS Simulator, id:4E7ACBF2-D991-49FF-A949-EBF206620640, OS:16.0, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:C944E87A-D90A-4436-9CF1-13697A9A20E0, OS:16.0, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:6C88747D-A158-4299-8FE3-D5A14274AD65, OS:16.0, name:iPhone 12 }
    { platform:iOS Simulator, id:A1C762C1-586A-4F3E-BD5E-D1107A7A3DC5, OS:16.0, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:DC323D96-0FB9-4804-821B-6B300989071A, OS:16.0, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:3713AE79-E945-4437-9543-EDEADD55A20F, OS:16.0, name:iPhone 12 mini }
    { platform:iOS Simulator, id:43D651EB-53C5-4DB1-B768-A96A0D995551, OS:16.0, name:iPhone 13 }
    { platform:iOS Simulator, id:68F75521-508F-41B7-995E-738A67C0F69C, OS:16.0, name:iPhone 13 Pro }
    { platform:iOS Simulator, id:9335E9C2-BB1E-4746-9717-7E78801AD169, OS:16.0, name:iPhone 13 Pro Max }
    { platform:iOS Simulator, id:7BC5CAAC-D23C-45B4-A714-ECEB6C2439A1, OS:16.0, name:iPhone 13 mini }
    { platform:iOS Simulator, id:06242371-CE14-49AC-A16A-981EC1AC308D, OS:16.0, name:iPhone 14 }
    { platform:iOS Simulator, id:969BE080-BD61-4C30-8EBB-F8CD6C754986, OS:16.0, name:iPhone 14 Plus }
    { platform:iOS Simulator, id:595D8F66-C0F1-4854-8C17-C30035E04D0A, OS:16.0, name:iPhone 14 Pro }
    { platform:iOS Simulator, id:5BD654A4-2983-4C5C-B869-33FCDDED3492, OS:16.0, name:iPhone 14 Pro Max }
    { platform:iOS Simulator, id:CC7BF3A6-62CB-4AC3-9E13-ED20DA1CC9E0, OS:16.0, name:iPhone SE (3rd generation) }

[ad_2]