new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

distribute/macos

24 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Info.plist configuration in src-tauri folder

You can extend the Info.plist configuration by creating an Info.plist file in the src-tauri folder and including the key-value pairs you desire. Tauri automatically configures important properties such as app binary name, version, bundle identifier, and minimum system version. The custom Info.plist file is merged with the values generated by the Tauri CLI. Be careful when overwriting default values as they might conflict with other configuration values and introduce unexpected behavior.

Entitlements configuration for macOS apps

Entitlements are special Apple configuration key-value pairs that act as rights or privileges granting your app particular capabilities. To define entitlements: (1) Create an Entitlements.plist file in the src-tauri folder with the required key-value pairs; (2) Configure Tauri to use it in tauri.conf.json under bundle > macOS > entitlements with the path to the file. Entitlements are applied when your application is signed.

macOS minimum system version configuration

By default, Tauri applications support macOS 10.13 and above. To enforce a newer minimum version requirement, configure the `tauri.conf.json > bundle > macOS > minimumSystemVersion` value. For example, setting it to "12.0" requires macOS 12.0 or above.

macOS GUI apps do not inherit shell PATH environment

GUI apps on macOS and Linux do not inherit the $PATH from your shell dotfiles (.bashrc, .bash_profile, .zshrc, etc). Tauri provides the fix-path-env-rs crate to fix this issue.

macOS application bundle definition and purpose

An application bundle is a package format for applications running on macOS. It is a simple directory containing the application executable, resources, Info.plist file, and other files such as macOS frameworks that are necessary for the application to function properly.

Build macOS application bundle with Tauri CLI

To package an app as a macOS application bundle, run the `tauri build` command with the `--bundles app` flag on a Mac computer. The command is: `npm run tauri build -- --bundles app` (npm), `yarn tauri build --bundles app` (yarn), `pnpm tauri build --bundles app` (pnpm), `deno task tauri build --bundles app` (deno), `bun tauri build --bundles app` (bun), or `cargo tauri build --bundles app` (cargo).

macOS bundle directory structure

The macOS app bundle directory structure is: `<productName>.app/Contents/` contains Info.plist and additional files from tauri.conf.json bundle macOS files; `MacOS/` contains the app executable named `<app-name>`; `Resources/` contains icon.icns and resources from tauri.conf.json bundle resources; `_CodeSignature/` contains codesign information; `Frameworks/`, `PlugIns/`, and `SharedSupport/` are additional directories.

Info.plist configuration for macOS bundles

The app bundle is configured by the Info.plist file, which contains key-value pairs read by macOS. Tauri automatically sets important properties including the app binary name, version, bundle ID, and minimum system version. To extend the configuration, create an Info.plist file in the src-tauri folder and add required key pairs. Custom Info.plist values are merged with Tauri CLI-generated values. Overriding default values like application version may cause conflicts or unexpected behavior.

Info.plist example with camera and microphone permissions

Example Info.plist configuration: ```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>NSCameraUsageDescription</key> <string>Request camera access for WebRTC</string> <key>NSMicrophoneUsageDescription</key> <string>Request microphone access for WebRTC</string> </dict> </plist> ```

Info.plist localization with InfoPlist.strings files

The Info.plist file itself supports only a single language. To support multiple languages, create InfoPlist.strings files for each additional language. Each file is stored in a language-specific lproj directory within the Resources directory of the application bundle. The lproj directory must follow the naming convention `<lang-code>.lproj` where the language code typically follows BCP 47 (two-letter lowercase codes like de, fr, ja). The strings file must be named InfoPlist.strings (with capital I and P).

Project structure for Info.plist localization

To support Info.plist localization, create a directory structure in src-tauri like: `infoplist/de.lproj/InfoPlist.strings`, `infoplist/fr.lproj/InfoPlist.strings`. The `infoplist` directory name is customizable in the resources config, but the lproj directory names and InfoPlist.strings filename must follow the naming convention.

InfoPlist.strings example for German localization

Example de.lproj/InfoPlist.strings file for German localization: ```ini NSCameraUsageDescription = "Kamera Zugriff wird benötigt für WebRTC Funktionalität"; NSMicrophoneUsageDescription = "Mikrofon Zugriff wird benötigt für WebRTC Funktionalität"; ```

Configure resources to bundle Info.plist localization files

To automatically bundle localization files, use Tauri's resources feature in tauri.conf.json: ```json { "bundle": { "resources": { "infoplist/**": "./" } } } ``` This pattern copies all files from the infoplist directory into the bundle.

Entitlements definition and purpose in macOS

Entitlements are special key-value pair configurations from Apple that grant specific access rights and privileges to an app. Examples include allowing the app to act as the user's default email client or enabling App Sandbox functionality. Entitlements are applied during app code signing.

Create and configure Entitlements.plist file

To define entitlements for an application, create an Entitlements.plist file in the src-tauri folder with required key-value pairs. Then configure Tauri to use this file by setting the `bundle.macOS.entitlements` config in tauri.conf.json to point to the entitlements file path, for example: `"entitlements": "./Entitlements.plist"`.

Entitlements.plist example with App Sandbox

Example Entitlements.plist file: ```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/> </dict> </plist> ```

Tauri macOS default minimum system version

Tauri applications support macOS 10.13 (High Sierra) or later by default.

Configure minimum macOS system version

If your app uses APIs that require a newer macOS version, you can specify the minimum system version in tauri.conf.json using the `bundle.macOS.minimumSystemVersion` configuration. For example: ```json { "bundle": { "macOS": { "minimumSystemVersion": "12.0" } } } ```

Include macOS frameworks in bundle

If your application requires additional macOS frameworks to run, list them in the `bundle.macOS.frameworks` configuration in tauri.conf.json. The frameworks list can contain either system frameworks or custom frameworks and dylib files.

macOS frameworks configuration example

Example frameworks configuration: ```json { "bundle": { "macOS": { "frameworks": [ "CoreAudio", "./libs/libmsodbcsql.18.dylib", "./frameworks/MyApp.framework" ] } } } ```

System framework reference format

To reference system frameworks in tauri.conf.json, use the framework name without the .framework extension (e.g., "CoreAudio" instead of "CoreAudio.framework"). System frameworks must exist in one of these locations: `$HOME/Library/Frameworks/`, `/Library/Frameworks/`, or `/Network/Library/Frameworks/`.

Custom framework and dylib file reference

To reference local frameworks and dylib files in tauri.conf.json, use the complete path relative to the src-tauri directory.

Add custom files to macOS bundle

Use the `bundle.macOS.files` configuration in tauri.conf.json to add custom files to the application bundle. The configuration maps destination paths to source paths relative to tauri.conf.json. Custom files are added to the `<ProductName>.app/Contents` folder.

Custom files configuration example

Example custom files configuration: ```json { "bundle": { "macOS": { "files": { "embedded.provisionprofile": "./profile-name.provisionprofile", "SharedSupport/docs.md": "./docs/index.md" } } } } ``` This copies `profile-name.provisionprofile` to `<product-name>.app/Contents/embedded.provisionprofile` and `docs/index.md` to `<product-name>.app/Contents/SharedSupport/docs.md`.

Give your agent this brain