Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Notarize macOS Applications: A Step-by-Step Guide

Notarization is a security process implemented by Apple to ensure that macOS applications are free from malicious code. This process involves submitting your app to Apple for automated security checks. Once notarized, macOS can verify that the app is safe to run, which is essential for distributing apps outside the Mac App Store. This article will guide you through the steps to notarize your macOS application.

Prerequisites

Before you begin the notarization process, ensure you have the following:

  1. An Apple Developer account.
  2. Xcode installed on your macOS.
  3. Your app is signed with a Developer ID certificate.

Step-by-Step Notarization Process

1. Prepare Your App for Notarization

First, ensure your app is properly signed with your Developer ID certificate. You can do this using Xcode or the codesign command.

Example:

codesign --deep --force --verify --verbose --sign "Developer ID Application: Your Name (Team ID)" /path/to/your/app.app

2. Create a Compressed Archive of Your App

Apple requires that you submit your app as a ZIP file or a disk image (DMG). Here’s how to create a ZIP file:

Example:

cd /path/to/your/app
zip -r MyApp.zip MyApp.app

3. Submit Your App for Notarization

Use the altool command to submit your app for notarization. You will need your Apple Developer credentials.

Example:

xcrun altool --notarize-app --primary-bundle-id "com.yourcompany.yourapp" --username "your-apple-id@example.com" --password "@keychain:AC_PASSWORD" --file /path/to/MyApp.zip

Note: You can store your Apple ID password in the keychain and reference it using @keychain:AC_PASSWORD.

4. Check the Notarization Status

After submitting, you’ll receive a RequestUUID. Use this UUID to check the status of your notarization request.

Example:

xcrun altool --notarization-info <RequestUUID> --username "your-apple-id@example.com" --password "@keychain:AC_PASSWORD"

5. Staple the Notarization Ticket to Your App

Once your app is successfully notarized, you need to staple the notarization ticket to your app. This ensures that the notarization information is included with your app.

Example:

xcrun stapler staple /path/to/your/app.app

6. Verify the Stapling

Finally, verify that the stapling was successful.

Example:

xcrun stapler validate /path/to/your/app.app

Conclusion

Notarizing your macOS application is a crucial step in ensuring its security and compatibility with macOS. By following the steps outlined in this guide, you can successfully notarize your app and provide a safer experience for your users.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.