[docs] `tauri build --bundles dmg` can works?
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?
Yes it does work. The linked reference is auto generated on a Linux system and the help output is platform specific.
Since you opened another issue, here's how to build a universal app/dmg:
- Run
rustup target add aarch64-apple-darwin x86_64-apple-darwin - Run
npm run tauri build -- --target universal-apple-darwin- Add
-b dmgif you didn't configure tauri.conf.json to include all targets.
- Add
Note that thanks to apple this (currently) only works on macOS machines.
@FabianLars Thanks! I will try this command.
i'll reopen this because we really need to add back those instructions to the new docs (we've had it in v1)
@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
Like I said above, you can only build macos apps on a macos machine. Your CI seems to be running on Linux though.