Working on this project. https://github.com/sebsto/amplify-ios-getting-started
The project has a scheme named getting started
.
Using Xcode 14.3.1, I can use this command to build the project:
xcodebuild build -workspace getting\ started.xcworkspace -scheme "getting started" -configuration Release
But when using Xcode 15, it fails with the following error message:
Command line invocation:
/Applications/Xcode-15.app/Contents/Developer/usr/bin/xcodebuild build -workspace "getting started.xcworkspace" -scheme "getting started" -configuration Release
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Resolve Package Graph
Resolved source packages:
Starscream: https://github.com/daltoniam/Starscream @ 4.0.4
AmplifyUtilsNotifications: https://github.com/aws-amplify/amplify-swift-utils-notifications.git @ 1.1.0
SQLite.swift: https://github.com/stephencelis/SQLite.swift.git @ 0.13.2
XMLCoder: https://github.com/MaxDesiatov/XMLCoder.git @ 0.17.1
AppSyncRealTimeClient: https://github.com/aws-amplify/aws-appsync-realtime-client-ios.git @ 3.1.1
aws-crt-swift: https://github.com/awslabs/aws-crt-swift.git @ 0.6.1
Amplify: https://github.com/aws-amplify/amplify-swift @ 2.19.0
swift-log: https://github.com/apple/swift-log.git @ 1.5.3
swift-collections: https://github.com/apple/swift-collections @ 1.0.5
smithy-swift: https://github.com/awslabs/smithy-swift.git @ 0.15.0
aws-sdk-swift: https://github.com/awslabs/aws-sdk-swift.git @ 0.13.0
2023-10-18 01:51:45.235 xcodebuild[20775:97548] Writing error result bundle to /var/folders/c1/5nv1jx_s5ddcp_3l378t8_500000gn/T/ResultBundle_2023-18-10_01-51-0045.xcresult
xcodebuild: error: Found no destinations for the scheme 'getting started' and action build.
Self answering for the sake of posterity.
[SOLVED] with xcodebuild -downloadPlatform iOS
More Context:
This blog gave me a clue. https://mokacoding.com/blog/xcodebuild-destination-options/
When adding -destination generic/platform=iOS
to the xcodebuild
command, it gave a different error message.
xcodebuild build -workspace getting\ started.xcworkspace -scheme "getting started" -configuration Release -destination generic/platform=iOS
Command line invocation:
/Applications/Xcode-15.app/Contents/Developer/usr/bin/xcodebuild build -workspace "getting started.xcworkspace" -scheme "getting started" -configuration Release -destination generic/platform=iOS
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Resolve Package Graph
Resolved source packages:
...
2023-10-18 11:55:34.334 xcodebuild[14094:86335] Writing error result bundle to /var/folders/c1/5nv1jx_s5ddcp_3l378t8_500000gn/T/ResultBundle_2023-18-10_11-55-0034.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ generic:1, platform:iOS }
Ineligible destinations for the "getting started" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 17.0 is not installed. To use with Xcode, first download and install the platform }
I therefore download the iOS 17 simulator with xcodebuild -downloadPlatform iOS
And run the xcodebuild
command again. It works.