In 10 Steps
- Create the Certificates
- Create Provisioning File
- Create entitlements.plist
- Configure tauri.conf.json
- Set Version Number
- Create the App Bundle
- Add Provisioning Profile
- Sign the App Bundle
- Create Signed Package
- Upload
What You Need
Apple Account:- An Active Apple Account (duh)
- Apple Distribution Certificate
- 3rd Party Mac Developer Installer Certificate
- embedded.provisionprofile
- entitlements.plist
- Your_App_Name.app
- Xcode (required)
- Transporter (optional)
Certificates
- Apple Development Certificate
- 3rd Party Mac Developer Installer Certificate
Create Provisioning File
Create and download from your Apple account.Create Entitlements
File Name:entitlements.plist
Minimum Required Settings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key><true/>
<key>com.apple.security.network.client</key><true/>
</dict>
</plist>
Configure Tauri
File:src-tauri/tauri.conf.json
Add These:
{
"package": {
"productName": "App Name",
"version": "1.2.3"
},
"tauri": {
"bundle": {
"copyright": "Copyright Notice",
"identifier": "io.domain.app-name",
"macOS": {
"entitlements": "../entitlements.plist",
},
},
}
}
Set Version Number
Update these project files:package.json
src-tauri/Cargo.toml
src-tauri/tauri.conf.json
package.json:
"version": "1.2.3",
src-tauri/Cargo.toml:
version = "1.2.3"
src-tauri/tauri.conf.json:
"version": "1.2.3"
Create App Bundle
Build using TauriAdd Provisioning Profile
File:embedded.provisionprofile
Copy into the app bundle:
Your_App_Name.app/Contents/embedded.provisionprofile
The Script
All in a single bash script! Run this to build, sign, package and upload your app:# Set These:
APP_NAME="Your App Name Here"
PROJECT_DIR="/path/to/tauri/project"
APP_APPLE_ID="1234567890"
APP_BUNDLE_VERSION="20011231.120101"
APP_VERSION="1.2.3"
APP_BUNDLE_ID="com.domain.app-name"
USER="your-apple-id@domain.com"
PASSWORD="abcd-efgh-ijkl-mnop"
$APPLE_DISTRIBUTION_CERT="Apple Distribution: Your Cert Name Here"
$THIRD_PARTY_MAC_DEVELOPER_CERT="3rd Party Mac Developer Installer: Your Cert Name Here"
# Change if needed:
APP_BUNDLE="$APP_NAME.app"
APP_EXECUTABLE="$APP_BUNDLE/Contents/MacOS/$APP_NAME"
APP_PACKAGE="$APP_NAME.pkg"
# Build, Sign, Package, Upload:
npm run tauri build -- --target universal-apple-darwin
cp "$PROJECT_DIR/src-tauri/target/universal-apple-darwin/release/bundle/macos/$APP_BUNDLE" .
cp "embedded.provisionprofile" "$APP_BUNDLE/Contents/embedded.provisionprofile"
codesign \
--sign "$APPLE_DISTRIBUTION_CERT" \
--entitlements "entitlements.plist" \
"$APP_EXECUTABLE"
productbuild \
--sign "$THIRD_PARTY_MAC_DEVELOPER_CERT" \
--component "$APP_BUNDLE" "/Applications" \
"$APP_PACKAGE"
xcrun altool \
--upload-package "$APP_PACKAGE" \
--type macos \
--apple-id "$APP_APPLE_ID" \
--bundle-version "$APP_BUNDLE_VERSION" \
--bundle-short-version-string "$APP_VERSION" \
--bundle-id "$APP_BUNDLE_ID" \
-u "$USER" \
-p "$PASSWORD"