website
website copied to clipboard
[PAGE ISSUE]: 'Build and release a macOS app'
Page URL
https://docs.flutter.dev/deployment/macos/
Page source
https://github.com/flutter/website/tree/main/src/deployment/macos.md
Describe the problem
In Create a build archive with Codemagic CLI tools Point 13. Package the App the following code snipped is mentioned. My keychain for some reason contained multiple certs with the common name containing "Mac Developer Installer" so it found multiple common names which it simply concatenated into the variable INSTALLER_CERT_NAME
APP_NAME=$(find $(pwd) -name "*.app")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg
INSTALLER_CERT_NAME=$(keychain list-certificates \
| jq '.[]
| select(.common_name
| contains("Mac Developer Installer"))
| .common_name' \
| xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
rm -f unsigned.pkg
Expected fix
Changing it to jq '[.[]...][0] will only retrun the first common name of the cert which contains "Mac Developer Installer" in its common name.
APP_NAME=$(find $(pwd) -name "*.app")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg
INSTALLER_CERT_NAME=$(keychain list-certificates \
| jq '[.[]
| select(.common_name
| contains("Mac Developer Installer"))
| .common_name][0]' \
| xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
rm -f unsigned.pkg
Additional context
No response
Made The Changes To MacOS.md File Please Check If Found Any Decrepancy https://github.com/flutter/website/pull/7529
Fixed in https://github.com/flutter/website/pull/7529. Closing.