一、官方给出的方法
变更 CFBundleIdentifier
若要在Electron开发阶段对应用内购买功能进行测试,您必须在node_modules/electron/dist/Electron.app/Contents/Info.plist路径下修改CFBundleIdentifier。 您必须使用通过ITunes Connect创建的应用的bundle indentifier来替换掉com.github.electron。
<key>CFBundleIdentifier</key>
<string>com.example.app</string>
我用macos有时候不会生效
二、稳妥亲测有效的方案
使用masDev打包完成后,将xxx.app下的Info.plist
文件覆盖到node_modules/electron/dist/Electron.app/Contents/Info.plist
"build": {
"appId": "com.xxx.xxx",
"productName": "xxxxxx",
"copyright": "Copyright © 2024 xxxx",
"afterSign": "./build/notarize.js",
"buildDependenciesFromSource":