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

how to package a macos app? #79

Open
longzhaozhao1010 opened this issue Aug 30, 2021 · 6 comments
Open

how to package a macos app? #79

longzhaozhao1010 opened this issue Aug 30, 2021 · 6 comments

Comments

@longzhaozhao1010
Copy link

i use cargo build --release ,create a folder full of alias and it can't run in other mac

open in other mac it shows "open /Users/hank/Downloads/release/Qtalk.app
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10827 "kLSNoExecutableErr: The executable is missing" UserInfo={_LSLine=3762, _LSFunction=_LSOpenStuffCallLocal}"

@knopp
Copy link
Contributor

knopp commented Aug 30, 2021

By default the cargo build doesn't build self-contained bundles.

There is bundle_tool project that you can install using

cargo install bundle_tool

and which can create self contained bundles as well as codesign and notarize them, but I haven't had much time to document it. After installing you can run cargo bundle-tool --help and see the available options.

@ihenk
Copy link

ihenk commented Aug 30, 2021

Hi, there. We tried many times, but we failed. Could you offer us more specific information? What exactly does 'SOURCE_DIR' mean? What exactly does 'OUT_DIR' mean? Thanks in advance.

@knopp
Copy link
Contributor

knopp commented Aug 30, 2021

Assuming you did cargo build --release and the bundle name is Qtalk.app

cargo bundle-tool -v macos-bundle target/release/Qtalk.app target/

This should create Qtalk.app bundle in the target folder that is self-contained (has no symlink to outside of bundle).

@ihenk
Copy link

ihenk commented Aug 30, 2021

I did cargo bundle-tool -v macos-bundle target/release/Qtalk.app target/ before cargo build release--. It didn't work, here is the reason below.

cargo bundle-tool -v macos-bundle /project/target/release/Qtalk.app target/
DEBUG [cargo_bundle_tool::macos::bundle] "/project/target/release/Qtalk.app/Contents": create directory
DEBUG [cargo_bundle_tool::macos::bundle] "/project/target/release/Qtalk.app/Contents/MacOS": create directory

** Tool failed with error **
File operation failed: Canonicalize, path: "target/Qtalk.app/Contents/MacOS/Qtalk", error: No such file or directory (os error 2)

@knopp
Copy link
Contributor

knopp commented Aug 30, 2021

Where are you running this? You need to run everything in the project directory.

cargo clean
cargo build --release
cargo bundle-tool -v macos-bundle target/release/Qtalk.app target/

This should create self-contained bundle in target/QTalk.app

@ihenk
Copy link

ihenk commented Aug 30, 2021

I did these commands in the project directory. cargo clean worked for us! Thank you so much for your help, we really appreciated it. By the way, 'NativeShell' is amazing, it's our livesaver.

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

3 participants