macOS

Build native macOS desktop applications with Bini.js.

macOS Overview

Bini.js allows you to build native macOS desktop applications using Tauri. Your React app is wrapped in a WKWebView binary, providing a native experience with full system access.

Native Binary

macOS app bundle (.app) with Developer ID signing

Code Signing

Developer ID and notarization support

Native APIs

Full access to macOS APIs via Tauri

macOS desktop apps are built using Tauri's WKWebView backend. Your app runs in a native window with full system access.

Requirements

Before building macOS apps, make sure you have the following installed:

  • Node.js 20.19.0 or higher
  • Xcode Command Line Tools — xcode-select --install
  • Full Xcode (for building and notarization) — Download
Xcode Command Line Tools are required to compile the Tauri backend. Full Xcode is recommended for distribution.

Native macOS

Build natively on macOS using the CLI. The development and build commands run directly on your Mac.

# Create a macOS project
npx create-bini-app@latest my-app --platform macos

# Navigate to project
cd my-app

# Install dependencies
npm install

# Run in development mode
npm run tauri:dev

# Build the macOS app bundle
npm run tauri:build

The build output is a native macOS application bundle (.app) ready for distribution.

Tip: Use --sign during scaffold to set up Developer ID signing.

Windows

Build macOS apps from Windows using GitHub Actions. This is the recommended approach for cross-platform builds.

GitHubGitHub Actions Workflow
.github/workflows/build-macos.yml
# .github/workflows/build-macos.yml
name: Build macOS App

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-macos:
    runs-on: macos-latest
    
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'
          
      - name: Install dependencies
        run: npm install
        
      - name: Build macOS app
        run: npm run tauri:build
        
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
          name: macos-build
          path: src-tauri/target/release/bundle/macos/*.app

Why GitHub Actions? Tauri recommends GitHub Actions for cross-platform builds because:

  • No local toolchain setup required
  • Consistent build environment
  • Automatic artifact generation
  • Works from any operating system
GitHub Actions runs on macOS runners to build native macOS applications. This works from any OS.

Linux

Build macOS apps from Linux using GitHub Actions. This is the recommended approach and is used by Tauri for cross-platform builds.

GitHubGitHub Actions Workflow
.github/workflows/build-macos.yml
# .github/workflows/build-macos.yml
name: Build macOS App

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-macos:
    runs-on: macos-latest
    
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'
          
      - name: Install dependencies
        run: npm install
        
      - name: Build macOS app
        run: npm run tauri:build
        
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
          name: macos-build
          path: src-tauri/target/release/bundle/macos/*.app

Why GitHub Actions? Tauri recommends GitHub Actions for cross-platform builds because:

  • No local toolchain setup required
  • Consistent build environment
  • Automatic artifact generation
  • Works from any operating system
GitHub Actions with macos-latest runners is the official Tauri-recommended approach for building macOS apps from Linux.

Creating a macOS App

Create a new Bini.js project targeting macOS:

npx create-bini-app@latest my-app --platform macos

Or use the interactive prompt and select macos:

Prompt: Which platform would you like to target?

web / windows / macos / linux / android / ios

Select macos and press Enter

npx create-bini-app@latest

Development

Run your macOS app in development mode:

npm run tauri:dev

This launches your app in a native macOS window with:

  • Hot reload for frontend changes
  • Native window with menu bar integration
  • Access to macOS APIs
  • Devtools for debugging

Building

Build a distributable macOS application:

npm run tauri:build

This creates a signed macOS app bundle in the src-tauri/target/release/bundle/macos/ directory.

Output Files

  • my-app.app — The main app bundle
  • my-app.dmg — Disk image for distribution
  • my-app.pkg — Installer package (if configured)
The build output is a native macOS application that runs without any additional dependencies.

Code Signing

Bini.js supports Developer ID signing and notarization for macOS binaries. Configure signing in src-tauri/tauri.conf.json:

src-tauri/tauri.conf.json
{
  "tauri": {
    "bundle": {
      "macOS": {
        "signing": {
          "identity": "Developer ID Application: Your Name (TEAM_ID)",
          "notarization": {
            "appleId": "your@email.com",
            "password": "your-app-specific-password",
            "teamId": "TEAM_ID"
          }
        }
      }
    }
  }
}

For GitHub Actions, you can use secrets for secure credential storage:

# In GitHub Actions workflow
- name: Build macOS app
  env:
    APPLE_ID: ${{ secrets.APPLE_ID }}
    APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
    TEAM_ID: ${{ secrets.TEAM_ID }}
  run: npm run tauri:build
For production distribution, Developer ID signing and notarization are required to avoid Gatekeeper warnings.