如何使用 Electron Forge 构建 Intel Mac 应用程序?

问题描述 投票:0回答:1

我正在使用 Electron Forge 从我的电子应用程序创建 dmg 文件。我正在使用

@electron-forge/maker-dmg
来制作 dmg。

我的客户抱怨 dmg 无法在他们的 Intel 机器上使用。我尝试搜索如何制作 Intel 版本的 dmg,但找不到。

有电子锻造专家吗?我正在使用 M1 Max 来构建应用程序。

我的

package.json
看起来像:

{
  "name": "XXX",
  "version": "XXX",
  "description": "XXX",
  "main": "main.js",
  "author": "Alex Styl",
  "license": "MIT",
  "devDependencies": {
    "@electron-forge/cli": "^6.0.0-beta.66",
    "@electron-forge/maker-deb": "^6.0.0-beta.66",
    "@electron-forge/maker-dmg": "^6.0.0-beta.66",
    "@electron-forge/maker-rpm": "^6.0.0-beta.66",
    "@electron-forge/maker-squirrel": "^6.0.0-beta.66",
    "@electron-forge/maker-zip": "^6.0.0-beta.66",
    "electron": "^21.0.0"
  },
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make"
  },
  "dependencies": {
    "electron-fetch": "^1.7.4",
    "electron-json-storage": "^4.5.0",
    "electron-prompt": "^1.7.0",
    "electron-squirrel-startup": "^1.0.0",
    // and others
  },
  "config": {
    "forge": {
      "packagerConfig": {
        "extendInfo": "Info.plist",
        "icon": "images/mac-icon.icns",
        "osxSign": {
          "identity": "XXX",
          "hardened-runtime": true,
          "entitlements": "entitlements.plist",
          "entitlements-inherit": "entitlements.plist",
          "signature-flags": "library"
        },
        "osxNotarize": {
          "appleId": "XXX",
          "appleIdPassword": "XXX"
        }
      },
      "makers": [
        {
          "name": "@electron-forge/maker-squirrel",
          "config": {
            "name": "XXX"
          }
        },
        {
          "name": "@electron-forge/maker-zip",
          "platforms": [
            "darwin"
          ]
        },
        {
          "name": "@electron-forge/maker-dmg",
          "config": {
            "format": "ULFO"
          }
        },
        {
          "name": "@electron-forge/maker-deb",
          "config": {}
        },
        {
          "name": "@electron-forge/maker-rpm",
          "config": {}
        }
      ]
    }
  }
}
electron electron-forge
1个回答
0
投票

制作/发布时,您可以传递

--arch
标志。

如果是 MacOS Intel 芯片,您应该通过

--arch x64

阅读更多这里有关电子Apple芯片支持的信息,以及这里了解更多电子锻造标志

© www.soinside.com 2019 - 2024. All rights reserved.