Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] tauri build --bundles dmg can works? #3097

Open
miro-ring opened this issue Jan 3, 2025 · 6 comments
Open

[docs] tauri build --bundles dmg can works? #3097

miro-ring opened this issue Jan 3, 2025 · 6 comments

Comments

@miro-ring
Copy link

https://v2.tauri.app/distribute/dmg/
This document says yarn tauri build --bundles dmg can works.

https://v2.tauri.app/reference/cli/#build
But in this document, dmg option is not valid.

How to bundle dmg which targets universal-apple-darwin?

@FabianLars
Copy link
Member

Yes it does work. The linked reference is auto generated on a Linux system and the help output is platform specific.

@FabianLars
Copy link
Member

Since you opened another issue, here's how to build a universal app/dmg:

  1. Run rustup target add aarch64-apple-darwin x86_64-apple-darwin
  2. Run npm run tauri build -- --target universal-apple-darwin
    • Add -b dmg if you didn't configure tauri.conf.json to include all targets.

Note that thanks to apple this (currently) only works on macOS machines.

@miro-ring
Copy link
Author

@FabianLars
Thanks! I will try this command.

@FabianLars
Copy link
Member

i'll reopen this because we really need to add back those instructions to the new docs (we've had it in v1)

@FabianLars FabianLars reopened this Jan 3, 2025
@miro-ring
Copy link
Author

miro-ring commented Jan 3, 2025

@FabianLars
I tried your solution.
When running the project locally, everything works fine, but in the CI environment, I keep encountering the error

warning: [email protected]: cc: error: unrecognized command-line option '-arch'
warning: [email protected]: cc: error: unrecognized command-line option '-mmacosx-version-min=10.13'
error: failed to run custom build command for `objc-sys v0.3.5`

How can I resolve this issue?

This is my CI script.

    execute:
      - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
      - export PATH="$HOME/.cargo/bin:$PATH"
      - rustup target add aarch64-apple-darwin x86_64-apple-darwin
      - apt-get update
      - apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf jq
      - VERSION=$(jq -r '.version' package.json)
      - yarn
      - cargo install tauri-cli --git https://github.com/tauri-apps/tauri
      - yarn tauri build -- --target universal-apple-darwin

Error occurs in yarn tauri build -- --target universal-apple-darwin

@FabianLars
Copy link
Member

Like I said above, you can only build macos apps on a macos machine. Your CI seems to be running on Linux though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants