Skip to content

[Feature]: iOS build #180

@thwbh

Description

@thwbh

Category

New Feature

Target Platform

iOS

Feature Description

This app is currently an Android exclusive. I want to provide binaries targeted towards iOS.

Proposed Solution / Mockup

tauri supports iOS builds. There's some plumbing required to make it work.

  1. macOS required
  2. Install Xcode from the Mac App Store (latest version recommended)
  3. Install Xcode Command Line Tools: xcode-select --install
  4. Apple Developer Account: Free account works for local testing, paid (99 $/year) required for App Store distribution and bundle signing
  5. Add iOS Rust targets: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
  6. Initialize tauri iOS: cargo tauri ios init and review the generated files
  • src-tauri/gen/apple/ - iOS project files
  • src-tauri/gen/apple/librefit.xcodeproj - Xcode project
  • src-tauri/tauri.conf.json - Check for iOS-specific configuration

Config update:

  • Update tauri.conf.json with iOS-specific settings:
  {
    "identifier": "io.tohowabohu.librefit",
    "bundle": {
      "iOS": {
        "minimumSystemVersion": "14.0",
        "developmentTeam": "YOUR_TEAM_ID"
      }
    }
  }
  • Review and update permissions in the tauri capabilties config

After that, the usual cargo tauri commands can be used for development and local tests.

For CI/CD a ios-templates folder might be needed, similar to android-templates overwriting generated files during the build process.

Problem Statement (Optional)

No response

Alternatives Considered (Optional)

No response

Additional Context (Optional)

ios-release.yml could look like this:

name: 'iOS Release'

  on:
    workflow_dispatch:

  permissions:
    contents: write

  jobs:
    build-ios:
      name: 'Build iOS App'
      runs-on: macos-latest

      steps:
        - name: Checkout repository
          uses: actions/checkout@v4

        - name: Setup Node.js
          uses: actions/setup-node@v4
          with:
            node-version: '20'
            cache: 'npm'

        - name: Install frontend dependencies
          run: npm ci

        - name: Setup Rust
          uses: dtolnay/rust-toolchain@stable
          with:
            targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios

        - name: Cache Rust dependencies
          uses: Swatinem/rust-cache@v2
          with:
            workspaces: src-tauri
            cache-all-crates: true
            shared-key: ios-build

        - name: Install Tauri CLI
          run: cargo install tauri-cli --version "=2.9.5" --locked

        - name: Initialize Tauri iOS
          working-directory: src-tauri
          run: cargo tauri ios init

        - name: Generate iOS icons
          working-directory: src-tauri
          run: cargo tauri icon icons/icon.png

        - name: Build iOS App
          working-directory: src-tauri
          run: cargo tauri ios build --target aarch64-apple-ios

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreview requiredIssue has not been assigned yettarget:iosBug/Feature is targeted towards the iOS release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions