Mac 应用商店指南
本页面简要概述了如何将您的 Wails 应用程序提交到 Mac 应用商店。
前提条件
- 您需要有一个 Apple 开发者帐户。 请在 Apple Developer Program 网站上找到更多信息
- 您需要在开发人员门户上创建证书(Certificates)、标识符(Identifiers)和应用程序。 更多内容请见下文
- 你的本地机器上需要安装 Xcode 命令行 工具
创建证书和标识符
- 前往您的 Apple 开发者帐户
- 在
证书(Certificates)、标识符(Identifiers)和个人资料(Profiles)下,单击标识符(Identifiers)并注册新的应用程序 ID。 使用格式 (com.example.app) - 在同一页面下,单击
证书(Certificates)并为 Mac App Store 分发生成新证书(Certificates)。 下载它们并将证书导入本地计算机上的秘钥串。
创建应用程序提交
- 前往 App Store Connect 网站
- 注册一个新应用程序并链接您在上一步中创建的包 ID
- 根据 Apple 的要求,使用正确的屏幕截图、描述等填充您的应用程序
- 创建新版本的应用
创建配置文件
- 转到 Apple 开发者资料 页面
- 为 Mac App Store Distribution 添加新的配置文件
- 将 Profile Type 设置为 Mac 并为上面创建的应用程序选择 App ID
- 选择 Mac App Distribution 证书
- 命名嵌入式配置文件并下载创建的配置文件。
Mac 应用商店流程
启用 Apple 的 App Sandbox
提交到 Mac 应用商店的应用程序必须在 Apple 的 App Sandbox 下运行。 您必须创建一个 entitlements.plist 文件才能使其工作。 建议在此路径 {PROJECT_DIR}/build/darwin/entitlements.plist 下创建此文件。
示例授权文件
这是来自 RiftShare 应用程序的示例授权文件。 作为参考,请输入您的应用所需的权限。 有关详细信息,请参阅 此站点。 您需要将团队 ID 和应用程序名称替换为您上面注册的名称。
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.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.application-identifier</key>
<string>TEAM_ID.APP_NAME</string>
<key>com.apple.developer.team-identifier</key>
<string>TEAM_ID</string>
</dict>
</plist>
Add the Embedded Provisioning Profile The Provisioning Profile created above needs to be added to the root of the application. 它需要命名为 embedded.provisionprofile。