I have a Mac app and via Xcode 13 I can archive, export and notarize with no problem.
I am now trying to create a command line script using xcodebuild, xcrun notarytool, and so forth and am struggling to get this to work
This line works fine to create the archive
xcodebuild -project MyProject.xcodeproj -scheme "MyProject - App" -configuration Release archive
These two lines seem to correctly work to create the MyProject.app.xcarchive
(though I am unclear about the exportOptionsPlist and whether I created that correctly)
/usr/bin/xcodebuild -exportArchive -archivePath "$ARCHIVE_PATH" -exportOptionsPlist "$EXPORT_OPTIONS" -exportPath "$EXPORT_PATH" -allowProvisioningUpdates /usr/bin/ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"
Finally, this runs but fails with numerous errors xcrun notarytool submit $ZIP_PATH --keychain-profile "myprofile" --wait
The first relevant entry is
"message": "The binary is not signed with a valid Developer ID certificate.",
So the question is, what did I leave out in the commands earlier such that the binary wasn't signed?
Thanks in advance
(An aside -- it would be really nice if xcode itself had an option to export the appropriate commands as a script to do a command line build)