Generate Xcode project for macOS Tauri apps
npm install @choochmeque/tauri-macos-xcode


Generate Xcode projects for macOS Tauri apps. Similar to tauri ios init but for macOS.
- Open macOS Tauri apps in Xcode
- Build and run from Xcode (Cmd+R)
- Debug with Xcode debugger and Instruments
- Profile performance with Xcode tools
- XcodeGen - brew install xcodegen
- Xcode
- A Tauri v2 project
- tauri-cli - cargo install tauri-cli (required for Archive/Release builds)
``bash`
npx @choochmeque/tauri-macos-xcode init
This will:
- Create the Xcode project in src-tauri/gen/apple-macos/src-tauri/icons/
- Generate app icons from tauri:macos:dev
- Add script to your package.json
- Add this package as a devDependency
`bash`
npm run tauri:macos:devor
yarn tauri:macos:devor
pnpm tauri:macos:devor
bun tauri:macos:dev
This starts the frontend dev server and opens Xcode. Then press Cmd+R in Xcode to build and run.
``
src-tauri/gen/apple-macos/
├── project.yml # XcodeGen configuration
├──
│ ├── Info.plist # App metadata
│ └──
├── Assets.xcassets/ # App icons (auto-generated from src-tauri/icons/)
├── scripts/
│ ├── build-rust.sh # Bash wrapper for build script
│ └── build.swift # Swift build script with Xcode diagnostics
├── Podfile # CocoaPods (if needed)
└── .gitignore
Debug builds (Cmd+R):
1. Xcode runs a build script that compiles Rust code with cargo buildtauri.conf.json
2. The app connects to your frontend dev server (configured in )
Release/Archive builds (Product → Archive):
1. Xcode runs cargo tauri build --no-bundle which builds frontend and embeds it into the binary
2. The app is self-contained and doesn't need a dev server
3. Ready for distribution via App Store or direct download
`bash`
npx @choochmeque/tauri-macos-xcode init [--path
Creates the Xcode project structure and generates the .xcodeproj using XcodeGen.
`bash`
npx tauri-macos-xcode dev [--open] [--path
Starts the frontend dev server (reads build.beforeDevCommand from tauri.conf.json) and optionally opens Xcode.
The tool reads configuration from your tauri.conf.json:
- productName - App nameidentifier
- - Bundle identifierversion
- - App versionbuild.beforeDevCommand
- - Command to start dev serverbuild.devUrl
- - Dev server URL
Icons are automatically generated from your Tauri icons during init. The tool looks for:src-tauri/icons/icon.png
- src-tauri/icons/128x128@2x.png
- src-tauri/icons/128x128.png
-
If no source icon is found, you can manually add icons to src-tauri/gen/apple-macos/Assets.xcassets/AppIcon.appiconset/.
Required sizes:
- 16x16, 16x16@2x
- 32x32, 32x32@2x
- 128x128, 128x128@2x
- 256x256, 256x256@2x
- 512x512, 512x512@2x
To debug Rust code in Xcode, use symbolic breakpoints:
1. Go to Debug → Breakpoints → Create Symbolic Breakpoint
2. Enter a function name (e.g., my_function or my_module::my_function)
3. Build and run with Cmd+R
You can also use LLDB commands in the debug console:
``
breakpoint set -f main.rs -l 10
Note: Clicking in the gutter doesn't work for .rs files since Xcode doesn't natively support Rust. Use symbolic breakpoints or LLDB commands instead.
Install XcodeGen:
`bash`
brew install xcodegen
The build script sources ~/.cargo/env`. Make sure Rust is installed via rustup.