build-dmg
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<EXTREMELY-IMPORTANT>
This skill runs `xcodebuild archive` + `exportArchive` and packages the result into a DMG. It touches code signing, provisioning, and export options.
Non-negotiable rules:
- Detect project/workspace, scheme, and team ID before building — never guess signing identity.
- If multiple schemes exist, ask the user which one to build.
- Do not auto-create or overwrite without explicit approval — wrong export options produce unsigned or wrong-distribution builds.
ExportOptions.plist - Use the helper script () from the project root. Do not inline xcodebuild commands.
helpers/build-dmg.sh - If is detected (
xcodegenpresent), runproject.ymlbefore building.xcodegen generate - Report the built DMG path, app version, and signing status clearly.
<EXTREMELY-IMPORTANT>
本技能会运行`xcodebuild archive` + `exportArchive`命令,并将结果打包为DMG文件。涉及代码签名、配置文件和导出选项相关操作。
不可违背的规则:
- 构建前先检测项目/工作区、方案和团队ID——绝不猜测签名身份。
- 如果存在多个方案,询问用户要构建哪一个。
- 未经明确许可,不得自动创建或覆盖——错误的导出选项会生成未签名或分发类型错误的构建产物。
ExportOptions.plist - 使用项目根目录下的辅助脚本()。不要直接嵌入xcodebuild命令。
helpers/build-dmg.sh - 如果检测到(存在
xcodegen文件),在构建前运行project.yml。xcodegen generate - 清晰报告已构建的DMG路径、应用版本和签名状态。
build-dmg
build-dmg
Inputs
输入项
- : Optional project, workspace, scheme, or signing hint
$request
- :可选的项目、工作区、方案或签名提示信息
$request
Goal
目标
Produce a DMG build by:
- resolving the right Xcode target inputs
- running the bundled helper script from the project root
- reporting the resulting DMG path and any packaging blockers
通过以下步骤生成DMG构建产物:
- 解析正确的Xcode目标输入信息
- 从项目根目录运行内置的辅助脚本
- 报告生成的DMG路径以及任何打包障碍
Step 0: Detect the packaging inputs
步骤0:检测打包输入信息
Read the repo and resolve:
- app name
- scheme
- project or workspace path
- location if it exists
ExportOptions.plist - file if present
VERSION - whether indicates
project.ymlxcodegen - team ID or signing hints if already present
If a required input is ambiguous, ask before building.
Success criteria: The build configuration is explicit before the helper runs.
读取仓库并解析:
- 应用名称
- 方案
- 项目或工作区路径
- 若存在,确定其位置
ExportOptions.plist - 若存在文件,读取该文件
VERSION - 是否表明使用
project.ymlxcodegen - 若已存在,获取团队ID或签名提示信息
若某个必填输入信息不明确,在构建前询问用户。
成功标准:辅助脚本运行前,构建配置已明确。
Step 1: Confirm helper and working directory
步骤1:确认辅助脚本和工作目录
The helper script lives next to this skill at:
helpers/build-dmg.sh
Run it from the project root so it can use the current repository as the build context.
Success criteria: The correct helper path and project root are established.
辅助脚本位于本技能的同级目录:
helpers/build-dmg.sh
从项目根目录运行该脚本,使其能将当前仓库作为构建上下文。
成功标准:已确定正确的辅助脚本路径和项目根目录。
Step 2: Build with explicit environment
步骤2:使用明确的环境变量进行构建
Provide the required environment variables such as:
APP_NAMESCHEME
Add optional variables only when the project actually needs them:
PROJECTWORKSPACEINFO_PLISTEXPORT_OPTIONSTEAM_IDVERSION_FILEUSE_XCODEGENDMG_BACKGROUND
Success criteria: The helper has all required inputs and only the needed optional ones.
提供所需的环境变量,例如:
APP_NAMESCHEME
仅当项目实际需要时才添加可选变量:
PROJECTWORKSPACEINFO_PLISTEXPORT_OPTIONSTEAM_IDVERSION_FILEUSE_XCODEGENDMG_BACKGROUND
成功标准:辅助脚本已获取所有必填输入信息,且仅包含所需的可选变量。
Step 3: Handle success or failure cleanly
步骤3:妥善处理成功或失败情况
On success, report:
- DMG output path
- app version and build number if available
- whether the file was changed
VERSION
On failure:
- summarize the real error
- surface the relevant or export failure lines
xcodebuild - identify whether the blocker is signing, scheme selection, export options, or build failure
Success criteria: The user gets either a usable artifact path or a clear blocker summary.
成功时,报告:
- DMG输出路径
- 若可用,应用版本和构建编号
- 文件是否已修改
VERSION
失败时:
- 总结实际错误
- 展示相关的或导出失败日志行
xcodebuild - 确定障碍类型是签名问题、方案选择问题、导出选项问题还是构建失败
成功标准:用户要么获得可用的产物路径,要么得到清晰的障碍总结。
Guardrails
防护规则
- Do not run this skill proactively.
- Do not assume -local helper paths; use the helper inside this skill directory.
.claude - Do not auto-create or overwrite export options without approval.
- Do not hide signing failures behind generic "build failed" summaries.
- 不得主动运行本技能。
- 不要假设本地辅助脚本路径;使用本技能目录内的辅助脚本。
.claude - 未经许可,不得自动创建或覆盖导出选项。
- 不要用通用的“构建失败”总结掩盖签名失败问题。
Output Contract
输出约定
Report:
- resolved app/project/workspace/scheme inputs
- whether the helper ran successfully
- DMG path on success
- version/build info if available
- exact blocker category on failure
报告以下内容:
- 已解析的应用/项目/工作区/方案输入信息
- 辅助脚本是否运行成功
- 成功时的DMG路径
- 若可用,版本/构建信息
- 失败时明确的障碍类型