Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

App built with target mas-dev can't be opened #8983

Open
vass-ivanweber opened this issue Mar 22, 2025 · 1 comment
Open

App built with target mas-dev can't be opened #8983

vass-ivanweber opened this issue Mar 22, 2025 · 1 comment

Comments

@vass-ivanweber
Copy link

vass-ivanweber commented Mar 22, 2025

Affected application works as expected before code signing. After code signing it "can't be opened". The app is built by executing this command:

electron-builder -c.mac.target=mas-dev -m --universal

Current stack:

electron: 35.0.2
electron-builder: 25.1.8

Entitlements:

entitlements.inherit.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.inherit</key>
    <true/>
  </dict>
</plist>

entitlements.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.application-groups</key>
    <string>ABC123.myApp</string>
    <key>com.apple.security.device.microphone</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.print</key>
    <true/>
    <key>com.apple.security.network.server</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
</dict>
</plist>

Configuration (package.json)

    "appId": "my.app",
    "productName": "MyApp",
    "directories": {
      "output": "dist/"
    },
    "files": [
      "main/",
      "node_modules/",
      "www/",
      "embedded.provisionprofile",
      "package.json"
    ],
    "mac": {
      "notarize": false,
      "hardenedRuntime": false,
      "gatekeeperAssess": false,
      "category": "myAppCategory",
      "icon": "icon.icns",
      "provisioningProfile": "embedded.provisionprofile"
    },
    "mas": {
      "entitlements": "entitlements.plist",
      "entitlementsInherit": "entitlements.inherit.plist"
    },

Running codesign --verbose=4 --deep --strict MyApp.app outputs this:

MyApp.app: valid on disk
MyApp.app: satisfies its Designated Requirement

So codesign should be fine.

Thanks in advance for your help.

@vass-ivanweber vass-ivanweber changed the title App built with target mas-dev quits immediately on launch App built with target mas-dev can't be opened Mar 22, 2025
@mmaietta
Copy link
Collaborator

I think it needs to be notarized in order to not be flagged as "Cannot be opened"? Not sure where you're building the app or if you're running it on the mac that you built the artifact on.

Please also try the newest version of electron-builder v26.0.12. I can't patch older versions of electron-builder due to the way the CI/CD works.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants