module.exports = asyncfunction (params) { // Only notarize the app on Mac OS only. if (process.platform !== 'darwin') { return; } console.log('afterSign hook triggered', params);
// Same appId in electron-builder. let appId = 'com.onmyway133.IconGenerator'
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`); if (!fs.existsSync(appPath)) { thrownewError(`Cannot find application at: ${appPath}`); }
console.log(`Notarizing ${appId} found at ${appPath}`);
This leads to Cannot find module 'react/lib/ReactComponentTreeHook' If we’re using binary, then rebuild, it is the problem that cause devTools not work
1
npx electron-builder
This goes to Cannot read property injection of undefined at react-tap-event-plugin
For a normal electron app created with npm init, we can use all features of ES6, but not the JSX syntax for React. We can use just Babel to transpile JSX, as used in IconGenerator
Install electron as dev npm install electron --save-dev Update electron-packager npm install electron-packager@latest --save-dev Use no space in app name
If you have multiple developer identities in your keychain:
electron-osx-sign searches your keychain for the first signing certificates that it can locate. If you have multiple certificates then it may not know which cert you want to use for signing and you need to explicitly provide the name:
1
electron-osx-sign "My App-mas-x64/My App.app" --identity="3rd Party Mac Developer Application: My Company, Inc (ABCDEFG1234)" --verbose
For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain.
Certificate
On developer.apple.com, create Mac App Distribution certificate. Make sure when we download in Keychain Access, it has associated private key
electron Bad CFBundleExecutable. Cannot find executable file
ERROR ITMS-90261: “Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle MyApp [com.onmyway133.MyApp.pkg/Payload/MyApp.app/Contents/Frameworks/MyApp (GPU).app] property list file.”
I get a problem that electron always shows default app icon. I tried using png, NativeImage, different icon sizes but still the problem. When I use electron-packager to make release build, the icon shows correctly, so it must be because of Electron caching or somehow 😠
Go to node_modules -> electron -> dist, right click on Electron, choose View Info
Drag another icns into the icon on the top left
Release with electron-packager
icon must be specified with __dirname (we already did) for electron-packager to pick up correct icons