macOS 번들
Tauri applications for macOS are distributed either with an Application Bundle (.app
file) or an Apple Disk Image (.dmg
file). The Tauri CLI automatically bundles your application code in these formats, providing options to codesign and notarize your application. Please note that .app
and .dmg
bundles can only be created on macOS as cross-compilation doesn't work yet.
GUI apps on macOS and Linux do not inherit the $PATH
from your shell dotfiles (.bashrc
, .bash_profile
, .zshrc
, etc). Check out Tauri's fix-path-env-rs crate to fix this issue.
Tauri 애플리케이션을 빌드하고 단일 실행 파일로 묶으려면 간단하게 다음 명령을 실행하면 됩니다:
- npm
- Yarn
- pnpm
- bun
- Cargo
npm run tauri build
yarn tauri build
pnpm tauri build
bunx tauri build
cargo tauri build
이는, 프론트엔드를 빌드(beforeBuildCommand
이 설정되었다면) 하고, Rust 바이너리를 컴파일하며, 외부 바이너리들과 리소스들을 모아 최종적인 플랫폼에 맞는 번들과 설치 프로그램을 생성합니다.
최소 시스템 버전 설정하기
The minimum version of the operating system required for a Tauri app to run on macOS is 10.13
. If you need support for newer macOS APIs like window.print
that is only supported from macOS version 11.0
onwards, you can change the tauri.bundle.macOS.minimumSystemVersion
. This will in turn set the Info.plist
LSMinimumSystemVersion property and the MACOSX_DEPLOYMENT_TARGET
environment variable.
바이너리 대상
Apple Silicon, Intel 기반 Mac 컴퓨터 또는 범용 macOS 바이너리를 대상으로 애플리케이션을 컴파일할 수 있습니다. By default, the CLI builds a binary targeting your machine's architecture. If you want to build for a different target you must first install the missing rust target for that target by running rustup target add aarch64-apple-darwin
or rustup target add x86_64-apple-darwin
, then you can build your app using the --target
flag:
tauri build --target aarch64-apple-darwin
: Apple silicon 컴퓨터 대상.tauri build --target x86_64-apple-darwin
: Intel 기반 컴퓨터 대상.tauri build --target universal-apple-darwin
: produces a universal macOS binary that runs on both Apple silicon and Intel-based Macs.
While Apple silicon machines can run applications compiled for Intel-based Macs through a translation layer called Rosetta, this leads to a reduction in performance due to processor instruction translations. It is common practice to let the user choose the correct target when downloading the app, but you can also choose to distribute a Universal Binary. Universal Binaries include both aarch64
and x86_64
executables, giving you the best experience on both architectures. Note, however, that this increases your bundle size significantly.
애플리케이션 번들 커스터마이징
The Tauri configuration file provides the following options to customize your application bundle:
- Bundle name: Your app's human-readable name. Configured by the
package.productName
property. - Bundle version: Your app's version. Configured by the
package.version
property. - Application category: The category that describes your app. Configured by the
tauri.bundle.category
property. You can see a list of macOS categories here. - Copyright: A copyright string associated with your app. Configured by the
tauri.bundle.copyright
property. - Bundle icon: Your app's icon. Uses the first
.icns
file listed in thetauri.bundle.icon
array. - Minimum system version: Configured by the
tauri.bundle.macOS.minimumSystemVersion
property. - DMG license file: A license that is added to the
.dmg
file. Configure by thetauri.bundle.macOS.license
property. - Entitlements.plist file: Entitlements control what APIs your app will have access to. Configured by the
tauri.bundle.macOS.entitlements
property. - Exception domain: an insecure domain that your application can access such as a
localhost
or a remotehttp
domain. It is a convenience configuration aroundNSAppTransportSecurity > NSExceptionDomains
settingNSExceptionAllowsInsecureHTTPLoads
andNSIncludesSubdomains
to true. Seetauri.bundle.macOS.exceptionDomain
for more information.
These options generate the application bundle Info.plist file. You can extend the generated file with your own Info.plist
file stored in the Tauri folder (src-tauri
by default). The CLI merges both .plist
files in production, and the core layer embeds it in the binary during development.