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?
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).
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With