【问题标题】:ElectronJS app icon not appearing in Apple App Store ConnectElectronJS 应用程序图标未出现在 Apple App Store Connect 中
【发布时间】:2023-03-12 22:12:02
【问题描述】:

我正在为 MacOS 编写一个 electronJS 应用程序。我的构建工作正常,运行electron-forge make 命令后我可以完美地运行应用程序。该图标也会出现在文件中。

然后我按照这份文件签署了我的申请:https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide using electron-forge。

#!/bin/bash

# Name of your app.
APP="YourApp"
# The path of your app to sign.
APP_PATH="/path/to/YourApp.app"
# The path to the location you want to put the signed package.
RESULT_PATH="~/Desktop/$APP.pkg"
# The name of certificates you requested.
APP_KEY="3rd Party Mac Developer Application: Company Name (APPIDENTITY)"
INSTALLER_KEY="3rd Party Mac Developer Installer: Company Name (APPIDENTITY)"
# The path of your plist files.
CHILD_PLIST="/path/to/child.plist"
PARENT_PLIST="/path/to/parent.plist"
LOGINHELPER_PLIST="/path/to/loginhelper.plist"

FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"

codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Electron Framework"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libnode.dylib"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/Contents/MacOS/$APP Helper"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/"
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper"
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP"
codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH"

productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"

签名成功,生成myapp.pkg文件。

然后我尝试使用 Transporter https://apps.apple.com/us/app/transporter/id1450874784 将此 myapp.pkg 提交到 Apple App Store Connect

它可以成功提交应用程序,但我的应用程序图标(在我的桌面上正确显示)没有出现在此处或 App Store Connect 中,而是显示它的默认图标。

我正在使用 .icns 文件。任何关于如何让我的图标出现的想法将不胜感激。

【问题讨论】:

    标签: node.js macos electron app-store-connect electron-forge


    【解决方案1】:

    如果您将此文件添加到您的电子锻造项目中,entitlements.mac.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.cs.disable-library-validation</key><true/>
        <key>com.apple.security.cs.allow-jit</key><true/>
        <key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
        <key>com.apple.security.cs.allow-dyld-environment-variables</key><true/>
        <key>com.apple.security.files.user-selected.read-only</key><true/>
        <key>com.apple.security.files.user-selected.read-write</key><true/>
      </dict>
    </plist>
    

    和我的 electron-builder 配置用于集成此文件:

    pluginOptions: {
        electronBuilder: {
            removeElectronJunk: true,
            externals: ['typeorm', 'better-sqlite3'],
            nodeIntegration: true,
            mainProcessFile: 'src/main.js',
            rendererProcessFile: 'src/renderer.js',
            builderOptions: {
                appId: "electron-app",
                mac: {
                    icon: "./build/app-icon.icns",
                    entitlements: "./build/entitlements.mac.plist",
                    entitlementsInherit: "./build/entitlements.mac.plist",
                    darkModeSupport: true
                },
    

    【讨论】:

      猜你喜欢
      • 2021-04-03
      • 2021-06-18
      • 2022-10-09
      • 2020-07-15
      • 1970-01-01
      • 2017-03-28
      • 1970-01-01
      • 2019-07-05
      • 1970-01-01
      相关资源
      最近更新 更多