> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建测试光盘

> 创建测试光盘

<Note>这些说明仅用于测试目的。对于零售场景，此数据将根据合作伙伴中心中的元数据自动配置。创建编译光盘流程中所选的选项用于控制安装顺序、自动播放等。在向我们提交游戏进行接收时，你无需直接提交测试元数据或 JSON 配置文件。</Note>

本主题介绍如何创建测试光盘。可以创建以下类型的测试光盘。

* [编译光盘](#ID4E1)
* [多光盘](#ID4EBE)

<a id="ID4E1" />

## 编译光盘

### 创建测试编译光盘

要创建并测试编译光盘，你需要按以下所述创建 catalog.js 元数据文件和光盘布局。

* [创建光盘布局](#ID4EGB)
* [Catalog.js](#ID4EMC)
* [安装顺序与通知](#ID4ELD)
* [部署](#ID4EYD)

<a id="ID4EGB" />

### 创建光盘布局

创建如下所示的光盘布局。

```
- Disc Root
    - Licenses (folder) - (Not needed for Xbox One ERA Development Kits - make sure to use XVCs created with /LT flag)
        License0.xml (file) - (Not needed for Xbox One ERA dev kits - make sure to use XVCs created with /LT flag)
    - MSXC (folder)
        - Package1.xvc (file)
        - Package2.xvc (file)
        - Metadata (folder)
            - catalog.js (file)
            - Bundle (folder)
                - Bundle images (files)
            - Package1.xvc (folder)
                - Package 1 images (files)
            - Package2.xvc (folder)
                - Package 2 images (files)  
```

各目录包含以下内容：

* **Licenses** 包含游戏的许可证文件。XBOX One ERA 开发工具包不需要此信息。请务必使用带 **/LT** 标志创建的 XVC，之后可以省略这些文件。

* **MSXC** 包含已打包的游戏和 XBOX shell 所使用的元数据。

* **Metadata** 包含 shell 用于光盘上的游戏以及游戏包的元数据。

* **Bundle** 包含 shell 使用的图像。

* **Package1.XVC** 包含 shell 用于第一款游戏的图像。名称必须与 MSXC 中的游戏包文件名一致。

* **Package2.XVC** 包含 shell 用于第二款游戏的图像。名称必须与 MSXC 中的游戏包文件名一致。

<a id="ID4EMC" />

### Catalog.js

在 Metadata 文件夹中，创建名为 catalog.js 的文件。编辑此文件以反映其他文件夹中包和图像的名称。此文件必须使用 UTF-16 LE 编码。我们建议使用网页上的 JSON 校验工具。为确保 JSON 有效，请将其复制到文本编辑器中，然后以 UTF-16 LE 格式保存文件。

<a id="ID4ESC" />

##### 多游戏场景的 catalog.js 文件示例（含注释）

```js theme={null}
{
  "version": "4.1",                                        // Don't adjust this value.
  "bundle": {
    "oneStoreProductId": "9P436MXJ71GV",                   // Replace with your bundle product id.
    "titles": [
      {
        "locale": "default",
        "title": "Bundle Title"                            // Replace with bundle title.
      }
    ],
    "images": [
      {
        "size": "100x100",                                 // Don't change the size values.
        "image": "100x100_1.png"                           // Must match the image file names in MSXC\Metadata\Bundle\
      },
      {
        "size": "208x208",
        "image": "208x208_1.png"
      },
      {
        "size": "480x480",
        "image": "480x480_1.png"
      }
    ]
  },
  "packages": [                                             // This is an array of packages.
    {
      "packageName": "Package1.xvc",                        // Match your package name in MSXC\<package name> and MSXC\Metdata\<package name>
      "oneStoreProductId": "BX38WRFV50MJ",                  // Product id for package 1.
      "contentId": "2b05043b-4043-4ba0-80ed-fd4811c4b333",  // Content id for package 1.  Must match the content id of the package file.
      "franchiseGameHubId": "47445142-3636-3036-C048-464D4E574000", // Optional; Replace with the FranchiseGameHubId. This marks the package as a game hub
      "titleId": "037C3A1D",                                // Title id for package 1.
      "titles": [
        {
          "locale": "default",
          "title": "Killer Instinct"                        // Package 1 title.
        }
      ],
      "images": [
        {
          "size": "100x100",
          "image": "100x100_1.png"                          // Match file names in MSXC\Metadata\<Package1>\
        },
        {
          "size": "208x208",
          "image": "208x208_1.png"
        },
        {
          "size": "480x480",
          "image": "480x480_1.png"
        }
      ],
      "ratings": [
        {
          "system": "OFLC",
          "value": "M"
        },
        {
          "system": "DJCTQ",
          "value": "14"
        },
        {
          "system": "PCBP",
          "value": "Unrated"
        },
        {
          "system": "USK",
          "value": "16"
        },
        {
          "system": "ESRB",
          "value": "T"
        },
        {
          "system": "CERO",
          "value": "Unrated"
        },
        {
          "system": "CSRR",
          "value": "Unrated"
        },
        {
          "system": "COB",
          "value": "M"
        },
        {
          "system": "GRB",
          "value": "Unrated"
        },
        {
          "system": "PEGI",
          "value": "16"
        },
        {
          "system": "PEGIPortugal",
          "value": "Unrated"
        }
      ],
      "type": "Game"
  },
  {
    "packageName": "Package2.xvc",
    "oneStoreProductId": "BVC818MXZ6KG",
    "contentId": "4a6cb1d0-5ad3-47b7-9583-7480098b4a26",
    "associatedFranchiseGameHubId": "47445142-3636-3036-C048-464D4E574000", // Replace with the FranchiseGameHubId of the corresponding franchise game hub that this package is launched with. Optional;
    "titleId": "669E1864",
    "titles": [
      {
        "locale": "default",
        "title": "LocoCycle"
      }
    ],
    "images": [
      {
        "size": "100x100",
        "image": "100x100_1.png"
      },
      {
        "size": "208x208",
        "image": "208x208_1.png"
      },
      {
        "size": "480x480",
        "image": "480x480_1.png"
      }
    ],
    "ratings": [
      {
        "system": "OFLC",
        "value": "PG"
      },
      {
        "system": "DJCTQ",
        "value": "10"
      },
      {
        "system": "USK",
        "value": "12"
      },
      {
        "system": "ESRB",
        "value": "T"
      },
      {
        "system": "PEGI",
        "value": "12"
      },
      {
        "system": "COB",
        "value": "PG"
      }
    ],
    "type": "Game"
    }
  ]
}  
```

<a id="ID4EAD" />

##### 游戏与可下载内容 (DLC) 场景的 catalog.js 示例

```js theme={null}
{
  "version": "4.0",                                        // Don't adjust this value.
  "bundle": {
    "oneStoreProductId": "9P436MXJ71GV",                   // Replace with bundle product id.
    "launchPackage": "Package3.xvc",                       // Should be the package name of the game package.  This is the package that is launched when the game disc is inserted.
    "titles": [
      {
        "locale": "default",                                        
        "title": "Game + DLC Bundle Title"                 // Replace with bundle name.
      }
    ],
    "images": [
      {
        "size": "100x100",
        "image": "100x100_1.png"                           // Must match the image file names in MSXC\Metadata\Bundle\
      },
      {
        "size": "208x208",
        "image": "208x208_1.png"
      },
      {
        "size": "480x480",
        "image": "480x480_1.png"
      }
    ]
  },
  "packages": [
    {
      "packageName": "Package1.xvc",                       // Match folder name in MSXC\Metadata\<folder name>
      "oneStoreProductId": "BX38WRFV50MJ",                 // Replace with DLC 1 product id.
      "contentId": "ace6ef3b-0c5b-4f17-a651-390e75169d5c", // Replace with DLC 1 content id. This must match the content id of the package file.
      "allowedOneStoreProductIds": [
        "BVC818MXZ6KG"                                     // Should match the product id of the game that will load this DLC.
      ],
      "titles": [
        {
          "locale": "default",
          "title": "DLC Title 1"
        }
      ],
      "images": [
        {
          "size": "100x100",
          "image": "100x100_1.png"                         // Match file names in MSXC\Metadata\Package1.xvc\
        },
        {
          "size": "208x208",
          "image": "208x208_1.png"
        },
        {
          "size": "480x480",
          "image": "480x480_1.png"
        }
      ],
      "ratings": [
        {
          "system": "ESRB",
          "value": "E"
        }
      ],
      "type": "Durable"                                    // Indicates that this is a DLC package.
    },
    {
      "packageName": "Package2.xvc",
      "oneStoreProductId": "9P436MXJ71GV",
      "contentId": "b0f77189-d74c-4005-b351-955d380cb875",
      "allowedOneStoreProductIds": [
        "BVC818MXZ6KG"
      ],
      "titles": [
        {
          "locale": "en-US",
          "title": "DLC Title 2"
        }
      ],
      "images": [
        {
          "size": "100x100",
          "image": "100x100_1.png"
        },
        {
          "size": "208x208",
          "image": "208x208_1.png"
        },
        {
          "size": "480x480",
          "image": "480x480_1.png"
        }
      ],
      "ratings": [
        {
          "system": "ESRB",
          "value": "E"
        }
      ],
      "type": "Durable"
    },
    {
      "packageName": "Package3.xvc",
      "oneStoreProductId": "BVC818MXZ6KG",
      "contentId": "5519355c-bff9-40b4-92bb-b5473fd9c577",
      "titleId": "35c8f637",
      "titles": [
        {
          "locale": "default",
          "title": "Game Title"
        }
      ],
      "images": [
        {
          "size": "100x100",
          "image": "100x100_1.png"
        },
        {
          "size": "208x208",
          "image": "208x208_1.png"
        },
        {
          "size": "480x480",
          "image": "480x480_1.png"
        }
      ],
      "ratings": [
        {
          "system": "ESRB",
          "value": "E"
        }
      ],
      "type": "Game"                                       // Indicates main game package.
    }
  ]
}  
```

<a id="ID4ELD" />

### 安装顺序与通知

DLC 安装通知通常在某个 DLC 包完成安装时触发。对于某些类型的游戏光盘，存在不希望触发通知的情况，因为这会在很短时间内产生大量通知。例如，年度版本可能会在光盘上包含大量小型 DLC 包。为处理此情况，仅当适用的游戏已安装时才触发 DLC 的通知。

对于包含大量小型 DLC 包的游戏，我们建议在光盘上对包排序，使 DLC 在游戏之前安装。这可确保在安装 DLC 包时不会让用户被大量通知淹没。

对于包含少量大型 DLC 包的游戏，我们建议在主游戏之后再安装 DLC，以确保用户不会因为要等到所有 DLC 包安装完成才能玩游戏而受阻。

要控制 DLC 与游戏的安装顺序，只需调整 catalog.js 中 *Packages* JSON 数组的顺序即可。此数组用于控制默认安装顺序。

<a id="ID4EYD" />

### 部署

要部署编译光盘，将目录结构刻录到光盘上。将光盘插入开发工具包时，其启动方式与零售版主机上的发行版本完全相同。

<a id="ID4EBE" />

## 多光盘

要创建测试多光盘，请将现有 XVC 拆分为两个文件。

<Note>XVC 只能在 Layout.xml 文件中定义的单个块边界处拆分。具有极大块（大于 45 GB）的 XVC 可能无法通过多光盘功能发布。一般来说，最好将游戏的块保持在 45 GB 以下。</Note>

要跨两张光盘拆分 XVC，创建类似以下内容的 DiscLayout.xml 文件。

```xml theme={null}
<Packages>
  <Package Name="MultiDisc" Description="Package published on 2 discs" MaxDiscs="2">
  </Package>
</Packages>  
```

接下来，调用 SplitPkg 生成将刻录到光盘的各个文件。这会生成两个文件，其名称为原 XVC 文件名分别附加 “.MultiDisc.1” 和 “.MultiDisc.2” 后缀。

```
SplitPkg /f DiscLayout.xml /p sourceXVC /s Multidisc /pd outputDir  
```

要模拟从多张光盘安装，请对光盘 1 使用 `xbapp install`，对光盘 2 也使用 `xbapp install`。光盘 1 上的内容安装完成后，主机会提示插入光盘 2。

<a id="ID4ENF" />

### Catalog.js

要刻录这些测试光盘，请创建包含新的 **discNumber**、**discCount** 和 **discSetId** 字段的 Catalog.js 文件。请注意，*每张*光盘都需要这些元数据。各光盘的 Catalog.js 文件之间唯一的差异是 **discNumber** 字段的值。例如，光盘 1 的值应为 1，光盘 2 的值应为 2。零 (0) 是保留值，不应使用。

<a id="ID4E5F" />

#### 多光盘的 Catalog.js 示例

```json theme={null}
{
  "version": "4.0",                                         // Don't adjust this value.
  "discNumber": 1,                                          // 1 for disc 1, 2 for disc 2.
  "discCount": 2,                                           // Same on all discs.
  "discSetId": "00000001",                                  // For test purposes, this can be 00000001. On retail discs, this value is unique for each published disc set. 
                                                            // Don't mix installations of test discs from different sets if they share this value. Cancel your installation before starting a new one.
  "packages": [                                             // This is an array of packages.
    {
      "packageName": "Package1.xvc",                        // Match your package name in MSXC\package-name and MSXC\Metdata\package-name
      "oneStoreProductId": "BX38WRFV50MJ",                  // Product id for package 1.
      "contentId": "2b05043b-4043-4ba0-80ed-fd4811c4b333",  // Content id for package 1. Must match the content id of the package file.
      "titleId": "037C3A1D",                                // Title id for package 1.
      "titles": [
      {
        "locale": "default",
        "title": "Killer Instinct"                          // Package 1 title.
      }
    ],
    "images": [
      {
        "size": "100x100",
        "image": "100x100_1.png"                            // Match file names in MSXC\Metadata\Package1\
      },
      {
        "size": "208x208",
        "image": "208x208_1.png"
      },
      {
        "size": "480x480",
        "image": "480x480_1.png"
      }
    ],
    "ratings": [
      {
        "system": "OFLC",
        "value": "M"
      },
      {
        "system": "DJCTQ",
        "value": "14"
      },
      {
        "system": "PCBP",
        "value": "Unrated"
      },
      {
        "system": "USK",
        "value": "16"
      },
      {
        "system": "ESRB",
        "value": "T"
      },
      {
        "system": "CERO",
        "value": "Unrated"
      },
      {
        "system": "CSRR",
        "value": "Unrated"
      },
      {
        "system": "COB",
        "value": "M"
      },
      {
        "system": "GRB",
        "value": "Unrated"
      },
        {
        "system": "PEGI",
        "value": "16"
      },
      {
        "system": "PEGIPortugal",
        "value": "Unrated"
      }
    ],
      "type": "Game"
    }
  ]
}  
```

## 另请参阅

* [创建跨代测试光盘](/build/core-features/common/packaging/creating-cross-gen-test-discs)
* [创建光盘](/build/core-features/common/packaging/creating-discs)
* [多光盘功能](/build/core-features/common/packaging/packaging-multi-disc)
* [Franchise Game Hubs](https://learn.microsoft.com/build/store/franchise-game-hubs)


## Related topics

- [创建光盘](/zh-CN/build/core-features/common/packaging/creating-discs.md)
- [跨代测试光盘概述](/zh-CN/build/core-features/common/packaging/creating-cross-gen-test-discs.md)
- [多光盘功能](/zh-CN/build/core-features/common/packaging/packaging-multi-disc.md)
- [流式安装与智能交付概述](/zh-CN/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery.md)
- [XBOX GDK 游戏的打包与部署](/zh-CN/build/core-features/common/packaging/index.md)
