Notarizing GMAT on macOS
General info about Apple’s notarization process is available at https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution
GMAT must be notarized before distributing it on macOS. Notarization is a process by which Apple scans all files in an application (executables and data) to ensure they are safe for public use. The GMAT development team notarizes and releases GMAT under NASA’s Apple organizational identity.
These instructions detail the requirements and process of notarizing GMAT on macOS prior to any type of distribution, including public (e.g. a GMAT release) or NASA-internal (e.g. release or testing versions). They apply to active members of NASA’s GMAT development team.
You must be an active member of NASA’s GMAT development team to notarize or distribute GMAT using NASA’s Apple Developer ID.
Apple Developer Setup
The notarization process requires NASA’s Apple developer certificates. To obtain these:
Create an Apple Account at https://account.apple.com
NASA best practice is to use your NASA email address for your Apple Account.
You do not need to add a credit card.
You do not need to enroll in the Apple Developer Program, that will automatically happen when your Apple ID is added to NASA’s developer account in a later step.
Create an App-Specific Password for the notarization process
Securely store the 16-character password before closing the generation window. It will no longer be retrievable after generation.
Any name is acceptable, e.g. “Notarize” or “Notarize on GMAT Mac”.
Note: All App-Specific Passwords are deleted and must be regenerated when the account password is changed
Contact the admin of NASA’s Apple Account, and give them a heads-up that you are a NASA GMAT developer who needs NASA developer certificates to notarize GMAT. You will be asked to submit a NAMS request for this.
The NASA GMAT project lead can provide the name of NASA’s Apple Account admin.
Create a NAMS request for “Agency Apple Developer”.
Sponsor: GMAT project lead
Role: Developer
Justification: “The NASA GMAT (General Mission Analysis Tool) software project needs to notarize GMAT for release on macOS.”
Apple ID: Your Apple Account email
Once your NAMS request is approved, you will be sent two developer certificates (P12 files) and associated passwords by email. One for
Applicationsigning and one forInstallersigning. Save them both to your computer.Download Apple’s master Developer ID certificate, which will authenticate the NASA certificates
Download the Apple Intermediate Certificate:
Developer ID - G2
Install the Developer ID certificate and both NASA certificates to your login keychain by double-clicking each one. They will be installed in the Keychain Access application. Note: As of macOS 14 Sonoma, there is a new Passwords application that handles most passwords, however Keychain Access still handles certificates.
Confirm that the certificates are installed by launching the Keychain Access application and searching for the following certificates:
Developer ID Application: NASADeveloper ID Installer: NASADeveloper ID Certification Authority: The correct one will haveOrganizational Unit: G2if you right-click and select “Get Info”.Both should show the message “ This certificate is valid”
Add the App-Specific Password to the local Keychain. This allows the password to only be entered once during the notarization process, and is required on any machine that will perform automated GMAT builds. This only needs to be done once for a given macOS account.
Open a Terminal and run the following command at the prompt
% xcrun notarytool store-credentials --apple-id "myappleid@organization.com" --team-id "82A95CK2HC"This will interactively prompt for the following inputs:
Desired Profile Name: recommend using the Apple ID
App-Specific Password: 16-character password created in the Apple Account
A success message indicates this step was successful
To retrieve a previously-created notary profile name, open Keychain Access and check the com.apple.gke.notary.tool entry. Its Account field should contain com.apple.gke.notary.tool…myappleid@organization.com corresponding to the Profile Name specified above.
GMAT Notarization
Once the App-Specific Password has been created and all certificates loaded, the GMAT application can be notarized.
Follow the instructions at Compiling GMAT (CMake Build System) to create a macOS build of GMAT. By default this will be called
GMAT-<versionName>-Darwin-x64where versionName is the current release, e.g.R2026a. It will be in the rootGMAT/source folder.Open a Terminal and navigate to the
GMAT/build/installfolderRun the following command to notarize GMAT
% mac_notarizeGMAT.sh -v <versionName> -u <notaryProfile> [-p <packageDirPath>]versionName: GMAT version, e.g. R2026anotaryProfile: notarytool profile name stored in keychain, in quotes if it has spaces. e.g.-u myappleid@organization.compackageDir: (Optional) Absolute path to GMAT folder to be distributed. If absent, assumes GMAT folder isGMAT-<versionName>-Darwin-x64and is located in the root of the GMAT repository (CMake default).
Notarization can take several minutes, and performs the following steps:
Copies the GMAT folder to an adjacent
GMAT <versionName>folder. This will be the final distributed folder.Uses the NASA developer certificate to sign all executables, files, and folders inside
GMAT <versionName>.Bundles the folder into a signed disk image
GMAT-<versionName>-Darwin-x64-signed.dmgUploads the signed disk image to Apple’s notary service. This step can take several minutes based on upload speeds and the current workload of Apple’s notarization servers.
If successful, Apple’s notary service will respond with
status: Accepted.
Attaches (in Apple’s terms, “staples”) the successful notarization ticket to the signed disk image.
If successful, the stapler will respond with
The staple and validate action worked!
If successful, this concludes the GMAT macOS notarization process! The signed disk image can be distributed per the rules of the signing authority.
Handling Notarization Errors
If errors happen while running the mac_notarizeGMAT.sh script, they will be either signing errors or notarization errors.
Signing Errors
Signing errors are either caused by improper certificate loading or issues with the GMAT folder being signed.
Certificate issues should be handled by ensuring that both NASA developer certificates indicate that they are trusted in the Keychain Access application.
GMAT folder issues should be addressed with the GMAT development team.
Notarization Errors
Apple’s notarization service is cloud-based, so errors must be diagnosed by retrieving the log file.
Find the notary submission id, which is shown during the notarization process. For example:
Submitting to notarization service - this may take a while ... Conducting pre-submission checks for GMAT-R2026a-Darwin-x64-signed.dmg and initiating connection to the Apple notary service... Submission ID received id: de28f82c-5200-4c66-9aae-1a6aba44b921Retrieve the notarization log file using the Submission ID and notary profile used during submission:
% xcrun notarytool log de28f82c-5200-4c66-9aae-1a6aba44b921 --keychain-profile myappleid@organization.comThis will show a log of all errors, which should be addressed with the GMAT development team.