You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My certificate works fine when I package the app by running
"electron-packager . $npm_package_productName --app-version=$npm_package_version --version=1.4.1 --out=../mac_builds --ignore='^/builds$' --platform=darwin --arch=x64 --icon=./app/icons/mac.icns --tmpdir=false --osx-sign.identity='Mac Developer: Arjun Kakkar (HQ3PJX83VN)' --overwrite"
How can I sign the electron executable so that auto updater runs fine when I use npm start with the source and not just after the app is packed so that I could also debug my code.
I want to debug the main process with the auto updater setFeedUrl set on a non packaged app like when I run from the terminal
Open Keychain.
Select login keychain, and My Certificates category.
Select all required certificates (hint: use cmd-click to select several):
Developer ID Application: to sign app for macOS.
3rd Party Mac Developer Application: and 3rd Party Mac Developer Installer: to sign app for MAS (Mac App Store).
Developer ID Application: and Developer ID Installer to sign app and installer for distribution outside of the Mac App Store.
Please note – you can select as many certificates, as need. No restrictions on electron-builder side. All selected certificates will be imported into temporary keychain on CI server.
Open context menu and Export.
Th0masDB, eranimo, milkv, Miaonster and fcastilloeclazlojuly, synapse, ArchieHicklin, Th0masDB, mitjans and 1 more
So, maybe this is too much information, but it took me a few hours to figure out how to sign the .app file. I'll list out what I did in the off chance it helps someone else (I am completely new at developing on a mac):
prereqs: you have electron-packager installed, you have electron-osx-sign installed, and you can build your target.
You need to create a cert through xcode. Additionally, you need to have an apple developer account:
On the accounts tab, add your apple id. Select it.
Select Manage Certificates.
Add whatever cert you are using. I am using a free account, so I did "Mac Development"
Take note of the cert name.
You have a cert, now you can sign the app. Assuming you were able to build it (I built mine using something like: "electron-packager . $npm_package_productName --app-version=$npm_package_version --out=builds --platform=darwin --arch=x64 --overwrite",) you can run something like: "electron-osx-sign ./builds/$npm_package_productName-darwin-x64/$npm_package_productName.app/ --identity='Mac Developer: [my email] ([this code thing])'" (the name of the cert).
Again, sorry if that is not the original question, but I was stuck for a few hours.
Th0masDB, ChristianLimes, amok, nicholaslee119, jordansinger and 29 more
Although closed, this issue helped me out so I'm leaving some useful information for future readers.
To further clarify a few points in regards to @jdell64 post -- the Accounts tab can be accessed by first opening the Preferences window in XCode which can be found under the File menu.
The proper certificate name cannot be seen through XCode. Once you've added a certificate, you'll need to open Keygen Access.app (use Spotlight search), click My Certificates from the left menu. Here you will see your certificate.
It is important to note with regards to auto updating, the use of a "Mac Development" certificate, to the best of my knowledge, would only enable auto updating on your own Mac. If you are releasing your application for others, you will need to add both Developer ID Application and Developer ID Installer certificates, which can only be added if you have a valid Developer ID which you get when you purchase a subscription to the Apple Developer Program.
mavrick, SMenigat, klenov, evgenykochetkov, darshan-jain-29 and 4 more
i met the same issue today .if you want to running by dev mode,you should sign electron.app.
step 1:create a new login type key in your mac.
step 2: go into your electron dist folder.ex:{project}/node_modules/electron/dist with cmd.
step 3:codesign --deep --force --verbose --sign "{your key name}" electron.app.
And then ,very thing will be ok.
ps:i am not good at english, forgive me :(
@shanesmith awesome solution.
For anyone searching for a way to sign your app during development, just use above to sign your node_modules/electron/dist/Electron.app and you should be good to go to debug the autoUpdater process
fengerzh, benjtinsley, srebalaji, mlalkaka, joshuapinter and 6 morejoshuapinter, shivarkarimi and alvinwan
Wow what a rabbit hole I went down to figure this out. Thanks everyone here for the pieces that got me to where I needed to go. The following is what I needed to do:
From within the app directory that electron-forge set up for me, I had to run the following:
codesign --deep --force --verbose --sign "Mac Developer: MY NAME (MY CODE)" node_modules/electron-prebuilt-compile/node_modules/electron/dist/Electron.app
This did the job for me (finally).
cgfarmer4, mdorda, joshuapinter, adhambadr, toannguyen1412 and 4 more
Activity
MarshallOfSound commentedon Oct 4, 2016
@arkakkar Sounds like you are using the
autoUpdater
API on a non-codesigned application. As per theautoUpdater
documentationhttp://electron.atom.io/docs/api/auto-updater/#macos
MarshallOfSound commentedon Oct 4, 2016
For further clarification, the packager signs your app. When you run
npm start
the pre-built Electron executable is not signedarkakkar commentedon Oct 4, 2016
How can I sign the electron executable so that auto updater runs fine when I use npm start with the source and not just after the app is packed so that I could also debug my code.
I want to debug the main process with the auto updater setFeedUrl set on a non packaged app like when I run from the terminal
arkakkar commentedon Oct 4, 2016
The issue is resolved. Code signing electron executable working. Thanks
jsgv commentedon Mar 2, 2017
@arkakkar How did you sign the Electron executable?
rvillanueva commentedon Mar 9, 2017
@JesusGalvan https://github.com/electron-userland/electron-builder/wiki/Code-Signing
How to Export Certificate on macOS
Open Keychain.
Select login keychain, and My Certificates category.
Select all required certificates (hint: use cmd-click to select several):
Developer ID Application: to sign app for macOS.
3rd Party Mac Developer Application: and 3rd Party Mac Developer Installer: to sign app for MAS (Mac App Store).
Developer ID Application: and Developer ID Installer to sign app and installer for distribution outside of the Mac App Store.
Please note – you can select as many certificates, as need. No restrictions on electron-builder side. All selected certificates will be imported into temporary keychain on CI server.
Open context menu and Export.
jdell64 commentedon Oct 25, 2017
So, maybe this is too much information, but it took me a few hours to figure out how to sign the .app file. I'll list out what I did in the off chance it helps someone else (I am completely new at developing on a mac):
prereqs: you have electron-packager installed, you have electron-osx-sign installed, and you can build your target.
Take note of the cert name.
"electron-packager . $npm_package_productName --app-version=$npm_package_version --out=builds --platform=darwin --arch=x64 --overwrite",
) you can run something like:"electron-osx-sign ./builds/$npm_package_productName-darwin-x64/$npm_package_productName.app/ --identity='Mac Developer: [my email] ([this code thing])'"
(the name of the cert).Again, sorry if that is not the original question, but I was stuck for a few hours.
phuze commentedon Nov 22, 2017
Although closed, this issue helped me out so I'm leaving some useful information for future readers.
To further clarify a few points in regards to @jdell64 post -- the Accounts tab can be accessed by first opening the Preferences window in XCode which can be found under the File menu.
The proper certificate name cannot be seen through XCode. Once you've added a certificate, you'll need to open Keygen Access.app (use Spotlight search), click My Certificates from the left menu. Here you will see your certificate.
For example:
I will further add, that if you are using electron-builder to package your application, then you will need to export your certificates. Read more about code signing and exporting your certificates.
It is important to note with regards to auto updating, the use of a "Mac Development" certificate, to the best of my knowledge, would only enable auto updating on your own Mac. If you are releasing your application for others, you will need to add both Developer ID Application and Developer ID Installer certificates, which can only be added if you have a valid Developer ID which you get when you purchase a subscription to the Apple Developer Program.
erynkyo commentedon Dec 19, 2017
i met the same issue today .if you want to running by dev mode,you should sign electron.app.
step 1:create a new login type key in your mac.
step 2: go into your electron dist folder.ex:{project}/node_modules/electron/dist with cmd.
step 3:codesign --deep --force --verbose --sign "{your key name}" electron.app.
And then ,very thing will be ok.
ps:i am not good at english, forgive me :(
shanesmith commentedon Jan 8, 2018
Building on @erynkyo I've found that you don't need to create a new key and can ad-hoc code sign by providing just a dash for the --sign param
codesign --deep --force --verbose --sign - electron.app
zewa666 commentedon Mar 9, 2018
@shanesmith awesome solution.
For anyone searching for a way to sign your app during development, just use above to sign your
node_modules/electron/dist/Electron.app
and you should be good to go to debug the autoUpdater processonassar commentedon Mar 9, 2018
Wow what a rabbit hole I went down to figure this out. Thanks everyone here for the pieces that got me to where I needed to go. The following is what I needed to do:
From within the
app
directory thatelectron-forge
set up for me, I had to run the following:This did the job for me (finally).
26 remaining items