# 從 fastlane 搬移商店資訊

> 如果你的 App Store 商店資訊保存在 fastlane 檔案夾中，可以請 Agent 檢查它、預覽匯入結果，並把文字、截圖和審查資訊上傳到 App Store Connect，或把商店資訊寫回 fastlane 檔案。

Source: https://air.build/tw/docs/app-store/bring-your-listing-from-fastlane/

fastlane 的 `deliver` 工具把 App 的 App Store 商店資訊保存在一個由文字檔、截圖和影片組成的檔案夾中。如果你的 App 的商店資訊就是這樣保存的，Agent 可以把這個檔案夾上傳到 App Store Connect，之後你就可以在 AirBuild 中繼續作業。它也可以把 App Store Connect 中目前的商店資訊寫入同樣結構的檔案夾。

> [!NOTE]
> AirBuild 沒有用於此操作的按鈕。你在專案的聊天中請 Agent 處理，它會使用 `asc migrate`（列在 [asc：自動化](https://air.build/tw/docs/cli/asc-automation/#migrate)的 `migrate` 下）。`asc` 會自己讀取檔案夾。之後要在畫面上修改商店資訊，請參閱[準備你的 App Store 頁面](https://air.build/tw/docs/app-store/prepare-your-store-page/)。

## 把檔案夾放進專案

- 如果專案來自你的儲存庫，而儲存庫中有 `fastlane` 檔案夾，它就已經在專案裡了。可以在 **檔案** 下查看（請參閱[尋找 Agent 製作的檔案和文件](https://air.build/tw/docs/projects/find-files/#open-files)）。要匯入儲存庫，請參閱[從 GitHub 匯入專案](https://air.build/tw/docs/get-started/import-from-github/)。
- 如果沒有，請把 `fastlane` 檔案夾壓縮成 zip 檔，在專案的聊天中傳送，並請 Agent 把它放進專案。請參閱[傳送照片、檔案和草圖給 Agent](https://air.build/tw/docs/projects/send-photos-and-files/)。

## 檔案夾包含什麼

`asc` 的說明列出了它讀取的結構：

- fastlane/
  - Deliverfile
  - metadata/
    - en-US/
      - name.txt
      - subtitle.txt
      - privacy_url.txt
      - description.txt
      - keywords.txt
      - release_notes.txt
      - promotional_text.txt
      - support_url.txt
      - marketing_url.txt
      - app_clip/
        - subtitle.txt
        - header_image.png
    - review_information/
      - first_name.txt
      - …
    - app_clip/
      - action.txt
  - app_previews/
    - en-US/
      - iphone_65/
        - preview.mp4
        - preview.poster_frame.txt
  - screenshots/
    - en-US/
      - iphone_65_1.png
      - …

| 檔案夾中的內容 | 在 App Store Connect 中對應的內容 |
| --- | --- |
| 某個語言檔案夾中的 `name.txt`、`subtitle.txt`、`privacy_url.txt` | 該語言下 App 的名稱、副標題和隱私權政策 URL。 |
| `description.txt`、`keywords.txt`、`release_notes.txt`、`promotional_text.txt`、`support_url.txt`、`marketing_url.txt` | 該語言下版本的描述、關鍵字、「此版本的新增功能」文字、行銷宣傳文字、支援 URL 和行銷 URL。 |
| `review_information/` | 版本的 App 審查聯絡人和示範帳號：`first_name.txt`、`last_name.txt`、`email_address.txt`、`phone_number.txt`、`demo_user.txt`、`demo_password.txt`、`demo_required.txt` 和 `notes.txt`。請參閱[準備你的 App Store 頁面](https://air.build/tw/docs/app-store/prepare-your-store-page/#app-review-contact)中的「App 審查聯絡資訊」。 |
| `screenshots/` 和某個語言 | 該語言下版本的截圖。`asc` 會根據檔名或圖片尺寸判斷每張截圖對應的裝置。 |
| `app_previews/`、某個語言和某種裝置 | App 預覽影片，每部影片可以附一張海報影格。 |
| `app_clip/` | App Clip 的副標題、標頭圖片和動作。 |
| `Deliverfile` | `asc` 會讀取其中的 `app_identifier`、`app_version`、`platform`、`metadata_path`、`screenshots_path`、`skip_metadata` 和 `skip_screenshots`。 |

## 檢查並預覽匯入

在專案的聊天中提出，例如：

```text
Our fastlane folder is in the project. Check it, then show me what importing it into version 1.4 would change.
```

1. Agent 用 `asc migrate validate` 檢查檔案夾。它只讀取檔案，不會聯絡 Apple，並列出超出 App Store Connect 字元限制的每一項名稱、副標題、描述、關鍵字、「此版本的新增功能」或行銷宣傳文字。描述為空的語言會收到警告。字元限制請參閱[準備你的 App Store 頁面](https://air.build/tw/docs/app-store/prepare-your-store-page/#fill-in-the-store-page)。
2. 它進行一次試執行 `asc migrate import --dry-run`，不會做任何變更。它會列出各個語言、每個語言的文字檔、審查資訊、依裝置分組的截圖，以及所有被略過的內容和原因。示範帳號密碼會以隱藏方式顯示。
3. 閱讀列表。要修改某項內容，請 Agent 編輯檔案，然後再檢查一次。

匯入的目標是某一個 App 的某一個版本。`asc` 從 Deliverfile 的 `app_identifier`、`app_version` 和 `platform` 取得它們，或根據你告訴 Agent 的內容決定。該版本必須已經存在於 App Store Connect 中：要建立版本，請參閱[發佈 App 更新](https://air.build/tw/docs/app-store/ship-an-update/#start-the-next-version)。

## 匯入

`asc` 只有在加上 `--confirm` 時才會匯入，所以 Agent 會先問你。它傳送的文字會取代該版本目前在 App Store Connect 中的內容，而 `asc` 不會保留舊文字的副本。如果想保留一份，請先請 Agent 把目前的商店資訊寫入另一個檔案夾（請參閱[把商店資訊寫回 fastlane 檔案](https://air.build/tw/docs/app-store/bring-your-listing-from-fastlane/#write-the-listing-back-into-fastlane-files)）。

你同意後，Agent 會執行 `asc migrate import --confirm`：

| 部分 | 結果 |
| --- | --- |
| 文字 | 更新每個語言的欄位。版本還沒有的語言會被加入。 |
| 審查資訊 | 建立或更新。如果 App Store Connect 中已有相同內容，則維持不變。 |
| 截圖 | 每張截圖上傳到對應裝置的截圖組中，並依檔案夾中的順序排列。如果截圖組中已有同名檔案，該截圖會以「already exists」（已存在）略過。已有的截圖不會被刪除。 |
| App Clip 標頭圖片 | 與 App Store Connect 中不同的標頭圖片會取代原有圖片。 |

Agent 會告訴你每個語言上傳了什麼。要查看結果，請打開 **App 資訊** › **商店頁面**。請參閱[準備你的 App Store 頁面](https://air.build/tw/docs/app-store/prepare-your-store-page/#open-app-information)。

如果想略過某些部分，請告訴 Agent：它可以略過截圖（`--skip-screenshots`）、App 預覽影片（`--skip-previews`）或 App Clip（`--skip-app-clip`）。

## 把商店資訊寫回 fastlane 檔案

例如可以這樣說：

```text
Write our App Store listing for version 1.4 into a fastlane folder in the project.
```

Agent 會對你指定的檔案夾使用 `asc migrate export`。對於每個語言，它會在 `metadata/` 下寫入 `name.txt`、`subtitle.txt`、`privacy_url.txt`、`description.txt`、`keywords.txt`、`release_notes.txt`、`promotional_text.txt`、`support_url.txt` 和 `marketing_url.txt`；如果版本有 App Clip 和 App 預覽，也會寫入相應的檔案。它不會寫入截圖和審查資訊。

如果檔案夾中已經有這些檔案，它會取代它們，並刪除在 App Store Connect 中為空的欄位所對應的檔案。如果想讓你的檔案夾維持原樣，請要求寫入一個新的檔案夾。

## 常見問題

**Agent 說需要 --version-id。**

Deliverfile 中沒有 `app_version` 和 `platform`。請告訴 Agent 要匯入到哪個版本，例如 1.4。

**它說找不到與該 Bundle ID 對應的 App。**

Deliverfile 中的 `app_identifier` 不是團隊所用 Apple 團隊中的 App。請檢查 Bundle ID：請參閱[尋找 App 的 Bundle ID 和最近一次建置](https://air.build/tw/docs/projects/find-your-apps-bundle-id/)。

**Deliverfile 中的路徑必須位於檔案夾內。**

Deliverfile 中的 `metadata_path` 或 `screenshots_path` 指向 fastlane 檔案夾之外，`asc` 不會跟隨這些路徑。請把這些檔案夾移到裡面，或告訴 Agent 你信任該路徑：它會加上 `--allow-external-metadata` 或 `--allow-external-screenshots`。

**它說 Deliverfile 中的路徑指向一個不存在的檔案夾。**

`asc` 會從 Deliverfile 所在的檔案夾解析其中的路徑。如果訊息附帶提示，例如 `./fastlane/metadata` 應為 `./metadata`，請 Agent 依提示修改 Deliverfile。

**匯入中途停止了。**

報告以「Partial Import - failed at」（部分匯入，失敗於）和出錯的步驟開頭，並附有失敗原因和已完成的步驟。已上傳的內容會保留。依失敗原因修正後，請 Agent 再次執行匯入：已上傳的截圖會以「already exists」（已存在）略過。

**它說需要 ffprobe。**

檔案夾中有 App 預覽影片，`asc` 會用 FFmpeg 的 `ffprobe` 檢查它們，而團隊的環境中沒有這個工具。請 Agent 安裝 FFmpeg，或不含影片匯入（`--skip-previews`）。

**影片或標頭圖片被拒絕。**

`asc` 的說明表示，預覽影片長度必須為 15 到 30 秒，App Clip 標頭圖片必須是 1800 x 1200 的 PNG。請替換檔案，或略過這一部分。

**它警告某個新語言缺少欄位。**

警告會說該語言「is still missing submit-required fields」（仍缺少提交所需的欄位），並列出這些欄位。提交前請把它們填好。請參閱[為 App Store 頁面加入語言](https://air.build/tw/docs/app-store/localize-your-store-page/)。
