tauri-apps / tauri-docs

The source for all Tauri project documentation.
https://tauri.app
MIT License
759 stars 528 forks source link

[docs] macOS app store info #691

Open despreston opened 2 years ago

despreston commented 2 years ago

I wanted to publish my app to the macOS app store and couldn't find any info about this in the docs. I was told on Discord that it's currently not possible. This seems like a commonly asked question based on the 10-20mins I spent poking around Discord history. I'm not sure if this is something thats on the roadmap, but regardless IMO it would be nice to include a blurb in the docs to mention that submitting to the mac app store is not supported.

Apologies if this is the wrong section or issue topic. Im kind of perplexed as to how there is so little info on this online and I'm not sure who to talk to about getting this feature added.

Regards

lorenzolewis commented 2 years ago

Would be good to put a longer explanation in the FAQ and then make sure we link to that in the respective macOS guides

despreston commented 2 years ago

I think that makes sense. 👍

klausbreyer commented 1 year ago

Can maybe link somebody those guides here? I found this through Google. I am new to desktop development, but have a lot of experience in the web. For me the reason to chose tauri or electron is dependent on the ease of having a workflow that produces something that I can directly submit to the Mac or windows App Store.

ZaneH commented 1 year ago

Here's the link to the docs: https://tauri.app/v1/guides/distribution/macos/ Another helpful link: https://tauri.app/v1/api/config/#macconfig You'll also need: https://tauri.app/v1/guides/distribution/sign-macos

despreston commented 1 year ago

Hi, @ZaneH. Looks like those links dont address the issue. Namely, I think the project needs to convey that it's not possible to publish the app to the app store.

kirankunigiri commented 1 year ago

I just landed here while google searching to see if it was possible to publish a Tauri app to the app store. I 100% agree with @despreston that it should be written very clearly in the docs, at the very least on the distribution page, because I couldn't find this info anywhere else besides this GitHub issue.

I originally started my Tauri project assuming it was possible (lack of forethought on my part), but unfortunately I have to shift to Electron because of the lack of App Store publishing. Being able to publish to the App Store is probably a pretty important factor for a lot of developers when choosing between Tauri/Electron/other frameworks, so I think it is important to mention this somewhere in documentation.

But I do have to say I really liked Tauri better than Electron due to the low build size and simplicity, and I hope App Store publishing becomes a possibility in the future!

buildnewapp commented 1 year ago

OMG,tauri app cannot be released to mac app store !!!

FabianLars commented 1 year ago

To be clear, it is possible to publish Tauri apps to the macOS app store. I heard of at least 3 Tauri apps that were already published there (don't know the app names, only the devs). What is indeed true is that Tauri doesn't streamline this process and doesn't even output the expected file format. We plan to add both docs and better tooling for this as soon as we can (we don't have an app we can publish yet tho). Until then, to my knowledge, all you need to convert your app to the needed .pkg format is a cli tool included in xcode. If i got that right it was something like this

sudo productbuild --component /path_to_app/appname.app /output_folder/Converted.pkg

I think it needs to be signed again after converting it, but i don't know how that's done manually right now.

Edit: Here's a tutorial on the conversion + signing part: https://www.miradore.com/knowledge/macos/converting-dmg-to-pkg-for-macos-application-deployment/

Zertz commented 1 year ago

I haven't had the chance to give a try yet but that comment by @ryan-bunkr seems very helpful!

simonhyll commented 10 months ago

Tracking this for 2.0 so we make sure all these questions are addressed in the new guides.

SeeRich commented 8 months ago

Any update on this? Is it still planned for the official 2.0 release?

stefanfmeyer commented 7 months ago

Great to hear if there is an update on this. Currently working on a Tauri app and planning to publish on Mac App Store

wtto00 commented 7 months ago

I am currently using tauri@1.5, and it is entirely feasible to publish to the app store.

I hope the following content can help some people. Please replace the COMPANY_NAME, TEAM_ID, APP_NAME, APP_IDENTIFIER with your specific information.

  1. Preparation
    • The configuration item tauri.bundle.macOS in the file src-tauri/tauri.conf.json is empty.
    • Ensure that the certificate 3rd Party Mac Developer Application: COMPANY_NAME (TEAM_ID) and 3rd Party Mac Developer Installer: COMPANY_NAME (TEAM_ID) is installed on the local machine.
    • Make sure to download the correct provision profile file from AppConnect to src-tauri/entitlements/Mac_App_Distribution.provisionprofile.
    • Ensure that the entitlements file has been created in src-tauri/entitlements/APP_NAME.entitlements. Reference content is as follows:
      <?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.security.files.user-selected.read-write</key>
       <true/>
       <key>com.apple.security.files.downloads.read-write</key>
       <true/>
       <key>com.apple.application-identifier</key>
       <string>TEAM_ID.APP_IDENTIFIER</string>
       <key>com.apple.developer.team-identifier</key>
       <string>TEAM_ID</string>
      </dict>
      </plist>
  2. Execute the following script

    unset APPLE_SIGNING_IDENTITY
    unset APPLE_CERTIFICATE
    sign_app="3rd Party Mac Developer Application: COMPANY_NAME (TEAM_ID)"
    sign_install="3rd Party Mac Developer Installer: COMPANY_NAME (TEAM_ID)"
    profile="src-tauri/entitlements/Mac_App_Distribution.provisionprofile"
    
    target="universal-apple-darwin"
    
    npx tauri build --target "${target}" --verbose
    # cargo tauri build --target "${target}" --verbose
    
    app_path="src-tauri/target/${target}/release/bundle/macos/APP_NAME.app"
    build_name="src-tauri/target/${target}/release/bundle/macos/APP_NAME.pkg"
    cp_dir="src-tauri/target/${target}/release/bundle/macos/APP_NAME.app/Contents/embedded.provisionprofile"
    entitlements="src-tauri/entitlements/APP_NAME.entitlements"
    
    cp "${profile}" "${cp_dir}"
    
    codesign --deep --force -s "${sign_app}" --entitlements ${entitlements} "${app_path}"
    
    productbuild --component "${app_path}" /Applications/ --sign "${sign_install}" "${build_name}"
  3. Upload to TestFlight Now you will find the file src-tauri/target/${target}/release/bundle/macos/APP_NAME.pkg. Upload this pkg file to TestFlight by Transporter.

Important: This pkg file cannot be directly double-clicked to install. If you do so, the installed program will not be able to open. You must upload it to TestFlight via Transporter or other means, and then install the app from TestFlight in order for it to run properly.

In fact, I did not upload my app to the Mac App Store because of the lack of the IAP plugin.


EDITED 2024-06-07

In order to publish on the Mac App Store, I created an IAP plugin. Feel free to give it a try if you need it. https://github.com/wtto00/tauri-plugin-iap


EDITED 2024-06-12

I am happy to say that my app has been published on the Mac App Store.

stefanfmeyer commented 7 months ago

I am currently using tauri@1.5, and it is entirely feasible to publish to the app store.

I hope the following content can help some people.

Please replace the COMPANY_NAME, TEAM_ID, APP_NAME, APP_IDENTIFIER with your specific information.

  1. Preparation

    • The configuration item tauri.bundle.macOS in the file src-tauri/tauri.conf.json is empty.

    • Ensure that the certificate 3rd Party Mac Developer Application: COMPANY_NAME (TEAM_ID) and 3rd Party Mac Developer Installer: COMPANY_NAME (TEAM_ID) is installed on the local machine.

    • Make sure to download the correct provision profile file from AppConnect to src-tauri/entitlements/Mac_App_Distribution.provisionprofile.

    • Ensure that the entitlements file has been created in src-tauri/entitlements/APP_NAME.entitlements.

Reference content is as follows:

 ```xml

 <?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.security.files.user-selected.read-write</key>

     <true/>

     <key>com.apple.security.files.downloads.read-write</key>

     <true/>

     <key>com.apple.application-identifier</key>

     <string>TEAM_ID.APP_IDENTIFIER</string>

     <key>com.apple.developer.team-identifier</key>

     <string>TEAM_ID</string>

   </dict>

 </plist>

 ```
  1. Execute the following script

    
    unset APPLE_SIGNING_IDENTITY
    
    unset APPLE_CERTIFICATE
    
    sign_app="3rd Party Mac Developer Application: COMPANY_NAME (TEAM_ID)"
    
    sign_install="3rd Party Mac Developer Installer: COMPANY_NAME (TEAM_ID)"
    
    profile="src-tauri/entitlements/Mac_App_Distribution.provisionprofile"
    
    target="universal-apple-darwin"
    
    npx tauri build --target "${target}" --verbose
    
    # cargo tauri build --target "${target}" --verbose
    
    app_path="src-tauri/target/${target}/release/bundle/macos/APP_NAME.app"
    
    build_name="src-tauri/target/${target}/release/bundle/macos/APP_NAME.pkg"
    
    cp_dir="src-tauri/target/${target}/release/bundle/macos/APP_NAME.app/Contents/embedded.provisionprofile"
    
    entitlements="src-tauri/entitlements/APP_NAME.entitlements"
    
    cp "${profile}" "${cp_dir}"
    
    codesign --deep --force -s "${sign_app}" --entitlements ${entitlements} "${app_path}"
    
    productbuild --component "${app_path}" /Applications/ --sign "${sign_install}" "${build_name}"
    
  2. Upload to TestFlight

    Now you will find the file src-tauri/target/${target}/release/bundle/macos/APP_NAME.pkg. Upload this pkg file to TestFlight by Transporter.

Important: This pkg file cannot be directly double-clicked to install. If you do so, the installed program will not be able to open. You must upload it to TestFlight via Transporter or other means, and then install the app from TestFlight in order for it to run properly.

In fact, I did not upload my app to the Mac App Store because of the lack of the IAP plugin.

This is gold. Thanks a lot!

klausbreyer commented 7 months ago

Thanks a lot. Should I ever be tempted to develop a macOS app again, publishing it to the app store will be the first thing to do.

ImageDeeply commented 6 months ago

For in-app purchase, is this relevant? https://crates.io/crates/iap

wflixu commented 5 months ago

thanks a lot, I hvae some extra information for the comers:

Two certificates are :

image

the profile must for the app Identifier ID and must be the type of Mac Distribution

image

image