simonwidjaja
simonwidjaja

Reputation: 559

How to package an electron app for "darwin-x64" on an Mac M1/Apple Silicone (arm64)?

Hi Electron Enthusiasts! How do I package an electron app for "darwin-x64" on an Mac M1/Apple Silicone (arm64)?

It is definitely possible, since a month ago I had an MacBookPro with M1 chip and I was using electron forge to package. The final product was a "darwin-x64" app. It showed up as "kind=intel" in Activity Monitor when executed and I shared the app with colleagues running good old intel macs. They were able to run it without any problems. Now I am on a new MacBookPro with M1 and I had to reinstall everything. Now electron forge outputs a 100% "arm64" version of my app. Which is perfect but I also have to package an intel version on this machine. I was searching on google for hours without any luck. So any help highly appreciated!

My electron forge config does NOT accept:

module.exports = {
  "packagerConfig": {
    "all": true, 
    "arch": "x64",
  }
}

What am I missing?

Upvotes: 7

Views: 10724

Answers (3)

Desmond
Desmond

Reputation: 361

You can use the following command with Universal architecture with electron forge as https://github.com/electron/universal is now available.

npm run make -- --arch=universal --platform=darwin

This simply builds for both mac versions and doubles the size of your app.

Upvotes: 5

hkitago
hkitago

Reputation: 61

This also worked for me: npx electron-builder --dir --mac --universal

Upvotes: 1

codingexplorer
codingexplorer

Reputation: 89

This worked for me:

electron-forge package --arch=x64 --platform=darwin

electron-forge doesn't accept all in packagerConfig and ignores arch and platform inside it too for some reason.

Upvotes: 5

Related Questions