Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron for MAS (Mac app store)

After doing a lot of research I've found that in order to build an electron app for the Mac App Store, it requires a special build of Electron. Previously though I've only used electron-prebuilt installed via npm.

Is there a way to install the mac app store version via npm or is there a pre-built version? I can't seem to find any such packages. I do notice the full code is here https://github.com/atom/electron/releases but, it would be nicer to have the dependencies remain in my package.json if possible. Is there a recommended way to set this up?

like image 561
Jason Avatar asked May 06 '26 03:05

Jason


2 Answers

First, you need to install electron-packager to package the app:

npm install -g electron-packager

Then, use:

electron-packager <sourcedir> <appname> --platform=darwin --arch=x64 --version=<Electron version> [optional flags...]

to package the app.

Note: replace arch with ia32 if you're packaging for 32-bit, or all to package for both.

Finally, you need to follow the guide for submission (and the Apple one).

like image 130
somebody Avatar answered May 11 '26 14:05

somebody


If you use electron-forge for packaging, you can run package command with parameter --platform=mas which will package your app with the right version of electron for Mac App store. I have done it successfully with my electron application.

electron-forge package --platform=mas
like image 37
Bing Avatar answered May 11 '26 16:05

Bing