Skip to main content

Command Palette

Search for a command to run...

PKG (Notorize,build,script)

Updated
2 min readView as Markdown

script

Create pkg which runs scripts

Reference link

sudo pkgbuild --root desktop-example-darwin-arm64 --install-location /Applications --scripts /path/to/your/Scripts testapp.pkg

NOTE
replace desktop-example-darwin-arm64 with the actual path of the folder where the .app file exist

replace /path/to/your/Scripts with the actual path of the Scripts folder.

actual path = Users/Desktop... or right click on files and copy path

Notorize

Step 1: Install Xcode Command Line Tools

Ensure you have Xcode Command Line Tools installed:

xcode-select --install

Follow the on-screen instructions to complete the installation if it's not already installed.

Step 2: Authenticate with Apple

Create an app-specific password for your Apple ID:

  1. Sign in to your Apple ID account page.

  2. In the Security section, click Generate Password below App-Specific Passwords.

  3. Follow the instructions to generate the password. Save this password for later use.

Step 3: Configurenotarytool

  1. Authenticate notarytool with your Apple ID:

     xcrun notarytool store-credentials "MyAppCredentials" --apple-id "your-apple-id" --team-id "your-team-id" --password "your-app-specific-password"
    

    Replace "your-apple-id", "your-team-id", and "your-app-specific-password" with your actual Apple ID, team ID, and app-specific password respectively.

Step 4: Sign Your App

Ensure your app is signed with the correct entitlements and hardened runtime enabled. Update your forge.config.js:

javascriptCopy codemodule.exports = {
  packagerConfig: {
    osxSign: {
      identity: 'Developer ID Application: Your Name (Team ID)',
      hardenedRuntime: true,
      'entitlements': 'path/to/entitlements.plist',
      'entitlements-inherit': 'path/to/entitlements.plist',
    },
  },
};

Replace 'Developer ID Application: Your Name (Team ID)' with your actual developer ID.

Step 5: Notarize Your App

  1. Create your .pkg file.

  2. Use notarytool to notarize the .pkg file:

     xcrun notarytool submit path/to/your-app.pkg --keychain-profile "MyAppCredentials" --wait
    

    Replace path/to/your-app.pkg with the path to your .pkg file.

Step 6: Staple the Notarization Ticket

Once notarization is complete, staple the notarization ticket to your .pkg file:

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

Step 7: Distribute Your App

After stapling, your .pkg file should be properly notarized and ready for distribution without causing security warnings.

To check notary logs

xcrun altool CREDENTIALS --notarization-info <id>