tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Code Signing macOS Application in development mode

Open wyhaya opened this issue 2 years ago • 5 comments

Describe the problem

In development mode, Tauri does not code-sign macOS app. If your app needs to call some API that require permission control, you will need to re-authorize each time.

Example:

preview

If your application saves 100 passwords in the keychain, every time you run tauri dev, macOS will think it is a new unauthorized app, so you will have to enter the password 100 times in this dialog, which greatly affects the development experience.


Code signing in development mode will especially make sense if your app needs to access any of the ones listed below.

2

Describe the solution you'd like

When run tauri dev, check the environment variables listed here: Code Signing macOS Applications. If configured, sign the app.

Alternatives considered

No response

Additional context

No response

wyhaya avatar Oct 01 '23 15:10 wyhaya

@wyhaya Can you tell what's the solution? Or even a workaround? Should I sign the app with self signed cert everytime it reloads? Is there a simple solution it will work with cargo tauri dev?

thewh1teagle avatar Jan 24 '24 09:01 thewh1teagle

After many many solutions I tried including AID repair to the disk, and playing with different options in keychain I found something that worked and stopped this password prompt without errors:

  1. Open keychain app from launchpad
  2. Find the key (probably with the name of your app) in Login / Local Items
  3. Right click on it and choose copy
  4. Navigate to system keys, right click and paste the key
  5. Delete the key from login
  6. Double click the key in system
  7. Switch to access control and choose 'Allow all applications to access this key'
  8. Save changes
  9. Restart the app and no more password prompts.

thewh1teagle avatar Jan 24 '24 10:01 thewh1teagle

@thewh1teagle Unfortunately that doesn't seem to work for me.

rtmotiondev avatar May 28 '24 08:05 rtmotiondev

Unfortunately that doesn't seem to work for me.

Double check it... I encountered the same issue again and that fixed it. macOS m1 14.5

thewh1teagle avatar Aug 12 '24 13:08 thewh1teagle