Giter Club home page Giter Club logo

Comments (6)

xtremforce avatar xtremforce commented on May 22, 2024 2

看到作者迁移到 tauri 了,应该可以试试编译通用版了吧。x64 虽然跑是能跑,但毕竟性能比起 ARM64 肯定是会差不少的。

tauri build --target universal-apple-darwin : produces a [universal macOS binary] which runs on both Apple silicon and Intel-based Macs.

While Apple silicon machines can run applications compiled for Intel-based Macs through a translation layer called Rosetta, this leads to a reduction in performance due to processor instruction translations.

It is common practice to let the user choose the correct target when downloading the app, but you can also choose to distribute a Universal Binary. Universal Binaries include both aarch64 and x86_64 executables, giving you the best experience on both architectures. Note, however, that this increases your bundle size significantly.

from chatbox.

Bin-Huang avatar Bin-Huang commented on May 22, 2024

没有区别,根据我在多台Arm64机器上的测试,chatbox是可以在两种架构上运行,我暂时也不知道什么原因,我也是第一次使用electron。你也可以下载试一下,应该是可以正常使用的。

from chatbox.

xtremforce avatar xtremforce commented on May 22, 2024

x64 架构可以在M1、M2 上无障碍运行,但性能会打折扣。我问了下 Ai 获得这样的回答:

Electron 怎样编译 macOS Universal APP?

Electron 可以让我们通过代码来开发跨平台的桌面应用程序。要编译 macOS 的 Universal APP,你可以按照以下步骤来执行:

在 macOS 上安装最新版本的 Xcode,这是编译 Native Node.js 模块所需的。
在您的 package.json 文件中添加 "target": "darwinuniversal" 以启用 ‘darwinuniversal’ 目标。
安装 node-pre-gyp。 node-pre-gyp 是一种使用 npm 来构建和安装本地的 Node.js 模块的工具。您可以通过运行 npm install node-pre-gyp --save-dev 来安装它。
修改你的 package.json,添加以下 scripts:
"scripts": {
"package-mac": "electron-builder --mac --x64 --arm64",
"postinstall": "node node_modules/electron-builder/install-app-deps.js"
}
其中 package-mac 命令指定 Electron 构建为 macOS Universal 应用程序。

运行 npm run package-mac 命令,开始构建。
构建完成后,你会得到一个名为 yourapp-1.0.0.dmg 的镜像文件,表示你的 macOS Universal APP 已经构建完成。

希望这些步骤能够帮助你成功构建 macOS Universal 的 Electron 应用程序。

from chatbox.

Bin-Huang avatar Bin-Huang commented on May 22, 2024

我也问过了,发现AI在 electron 上很多时候会给一些错误的回答,让我走了不少弯路😹

我是在 x64架构的机器上,用electeon-forge编译的arm64,但是实际测试在m1的机器上完全无法打开

from chatbox.

smutao avatar smutao commented on May 22, 2024

So "chatbox_0.2.0_x64.dmg" was compiled on Intel-chip Mac OS? Is it possible to compile on Apple-silicon Mac OS and distribute the executable? Thanks

from chatbox.

Bin-Huang avatar Bin-Huang commented on May 22, 2024

@smutao You can download and try it out. In my personal usage, I have found that the x64 installation package is also compatible with Apple Silicon Mac OS.

from chatbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.