PKG (Notorize,build,script)
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:
Sign in to your Apple ID account page.
In the Security section, click Generate Password below App-Specific Passwords.
Follow the instructions to generate the password. Save this password for later use.
Step 3: Configurenotarytool
Authenticate
notarytoolwith 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
Create your
.pkgfile.Use
notarytoolto notarize the.pkgfile:xcrun notarytool submit path/to/your-app.pkg --keychain-profile "MyAppCredentials" --waitReplace
path/to/your-app.pkgwith the path to your.pkgfile.
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>
