How to Publish Tauri 2.0 Apps to App Store

Rajesh Verma

·

Nov 11, 2024

coverimage

Deploying our first Tauri app to the Mac App Store came with a series of unexpected challenges, from preparation and code-signing to TestFlight submission. This guide walks you through each step needed to bring your Tauri app to production, helping you avoid common pitfalls and get your app live faster.

Interested in seeing our app in action? Check out Simple Invoice & Bill Maker on the App Store.

  • Prerequisites
    • Apple Developer Account
    • Mac and Xcode
  • Generate Apple Certificates
    • Creating certificate signing request
    • Creating Apple Distribution and Certificates
      • Go to https://developer.apple.com/account, make sure the right team is selected in top-right.
      • Select "Certificates" under Certificates, IDs & Profiles.
      • Click on the + button, to create a new certificate.
      • Select "Apple Distribution", and click Continue.
      • Now upload the signing request file, drag and drop the .csr file we created in first step, or click on "Choose file" to locate it in finder, Click Continue.
      • Click "Download" to save the certificate to your computer.
      • Follow the same steps to create another certificate of "Mac Installer Distribution" type, same way.
  • Installing Certificates

Now you must have two certificates, double click on each to install it to your keychain.

Verification:

- To check if certificates have installed properly or not.

  • Open Keychain Access app, Select "login" in left pane and click on "My Certificates". You should see something like below:
1.png
  • Or, you can run the command security find-identity -p macappstore -v in terminal, it should output something like below:
    2.png
  • Generate Provisioning profile

Now to create provision profile for your app, on apple developer portal Select "Profile" under Certificates, IDs & Profiles or goto https://developer.apple.com/account/resources/profiles/list

  • Click on the + button, to Register a New Provisioning Profile.
  • Select "Mac App Store Connect" under Distribution, Click Continue.
  • Select your App ID in next step, and certificate.
  • Give a name to profile, for e.g. my_app_distribution_profile
  • Click Generate, and download the profile to your computer.

Building Tauri app

  • Configuring Info.plist and entitlements files
    • Create a Info.plist file inside src-tauri folder.
<?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>ITSAppUsesNonExemptEncryption</key>
  <false/>
</dict>
</plist>
  • Create a file entitlements.plist inside src-tauri folder. Apple uses this file to determine, what all permissions your app will require.
  • Sample entitlements file. Make sure to replace the $TEAM_ID with your Apple Team ID and $IDENTIFIER with your App Identifier.
<?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/>
    <key>com.apple.security.network.server</key><true/>
    <key>com.apple.application-identifier</key>
    <string>$TEAM_ID.$IDENTIFIER</string>
    <key>com.apple.developer.team-identifier</key>
    <string>$TEAM_ID</string>
  </dict>
</plist>
  • Configuring Tauri
    • Setup the followings keys in src-tauri/tauri.conf.json
      • identifier - App ID (created in Apple developer account)
      • entitlements - Path to your entitlements file
      • embedded.provisionprofile - path to your provisioning profile(created in Apple developer account)
  • Sample
{
  "identifier": "com.domain.app-name",
   "bundle": {
      "category": "Utilities",
      "copyright": "Copyright © 2024",
      "macOS": {
          "files": {
            "embedded.provisionprofile": "path/to/profile-name.provisionprofile"
          },
          "entitlements": "./entitlements.plist"
        }
    }
}
  • Example
{
  "identifier": "com.itwaves.invoicemaker,
   "bundle": {
      "category": "Utilities",
      "copyright": "IT WAVES",
      "macOS": {
          "files": {
            "embedded.provisionprofile": "./invoice_maker_mac.provisionprofile"
          },
          "entitlements": "./entitlements.plist"
        }
    }
}
  • Update app version
    • You can update the desired app version to these files, make sure the versions match in all files.
      • package.json
      • src-tauri/Cargo.toml
      • src-tauri/tauri.conf.json
  • Build tauri universal bundle
    • Run the following command:
    • tauri build --target universal-apple-darwin
  • Signing app bundle and Creating package
    • After the above command has ran succesfully, you can follow the below to sign your pap bundle and creating package for uploading it to app store.
    • Codesign app bundle
      • Replace APPLE_DISTRIBUTION_CERT_NAME, PATH_TO_ENTITLEMENTS_FILE, YOUR_APP_NAME with appropriate values.
      • You can get the APPLE_DISTRIBUTION_CERT_NAME by running the security find-identity -p codesigning -v
        command, it will output something like "Apple Distribution: Company (Team ID)", that's what you need.
        • codesign \
                    --sign "APPLE_DISTRIBUTION_CERT_NAME" \
                    --entitlements "PATH_TO_ENTITLEMENTS_FILE" \
                    "./src-tauri/target/universal-apple-darwin/release/bundle/macos/YOUR_APP_NAME.app"
        • codesign \
                    --sign "Apple Distribution: IT WAVES (RXXXXXXXXXX)" \
                    --entitlements "./src-tauri/entitlements.mac.plist" \
                    "./src-tauri/target/universal-apple-darwin/release/bundle/macos/Invoice Maker.app"
    • Codesign app bundle
      • Replace APPLE_DISTRIBUTION_CERT_NAME, YOUR_APP_NAME with appropriate values.
      • You can get the MAC_INSTALLER_CERT_NAME by running the security find-identity -p macappstore -v
        command, it will output something like "3rd Party Mac Developer Installer: Company (Team ID)", that's what you need.
      • xcrun productbuild --sign "MAC_INSTALLER_CERT_NAME" --component "./src-tauri/target/universal-apple-darwin/release/bundle/macos/YOUR_APP_NAME.app" /Applications/ "YOUR_APP_NAME_SIGNED.pkg"
      • xcrun productbuild --sign "3rd Party Mac Developer Installer: IT WAVES (RXXXXXXXXXX)" --component "./src-tauri/target/universal-apple-darwin/release/bundle/macos/Invoice Maker.app" /Applications/ "InvoiceMakerSigned.pkg"
  • Upload with Transporter app.
    • To upload the app to TestFlight, download and install Transporter app.
      https://apps.apple.com/us/app/transporter/id1450874784?mt=12
    • Login with your Apple Developer Account, select the YOUR_APP_NAME_SIGNED.pkg created in last step and hit upload. It will be uploaded to Testflight, you can test and submit the app for Store Review and make it live.
3.png