# 推出前從 TestFlight 試用你的 App Clip

> 讓 Agent 為 TestFlight 建置版本中的 App Clip 加入測試連結，然後在 iPhone 上從 Apple 的 TestFlight App 開啟這些連結。

Source: https://air.build/tw/docs/app-store/test-your-app-clip-in-testflight/

App Clip 的連結只有在包含該 App Clip 的版本獲得核准並上線後才能開啟它（請參閱[推出 App Clip](https://air.build/tw/docs/app-store/ship-an-app-clip/)）。在此之前，你和你的測試人員可以從 Apple 的 TestFlight App 開啟它。每個 TestFlight 建置版本都可以附帶 App Clip 測試連結，每個連結都有一個標題。Apple 稱之為 App Clip 呼叫。請參閱 Apple 的[測試 App Clip 體驗](https://developer.apple.com/help/app-store-connect/test-a-beta-version/test-an-app-clip-experience)。

> [!NOTE]
> **TestFlight** 和 **App Clip** 標籤頁無法加入測試連結。請在專案的聊天中詢問 Agent。它會使用 `asc app-clips invocations`（列在 [asc：App 與 App Store 頁面](https://air.build/tw/docs/cli/asc-apps/#app-clips) 的 `app-clips` 下）和 `asc build-bundles`（見 [asc：建置版本與 TestFlight](https://air.build/tw/docs/cli/asc-builds/#build-bundles)）。

## 開始之前

- 已經上傳了包含該 App Clip 的 TestFlight 建置版本。請參閱[推出 App Clip](https://air.build/tw/docs/app-store/ship-an-app-clip/#add-an-app-clip-to-your-app)和[用 TestFlight 分享 Beta 版](https://air.build/tw/docs/app-store/test-with-testflight/#upload-a-new-build)。
- 你是該建置版本的測試人員：你在擁有該建置版本的群組中，並且你的 iPhone 上裝有 Apple 的 TestFlight App。請參閱[用 TestFlight 分享 Beta 版](https://air.build/tw/docs/app-store/test-with-testflight/#invite-testers)。
- 你的網站和 App Clip 已相互關聯。Apple 表示，從 TestFlight 測試需要這一點，並在[將你的 App Clip 與網站建立關聯](https://developer.apple.com/documentation/appclip/associating-your-app-clip-with-your-website)中作了說明。

## 加入測試連結

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

```text
Add an App Clip test link to the latest TestFlight build: https://example.com/menu, titled "Order ahead".
```

1. Agent 按建置編號找到該建置版本，或使用最新的建置版本。
2. 它用 `asc build-bundles list` 找到建置版本中的 App Clip。
3. 它用 `asc app-clips invocations create` 以一種語言加入連結及其標題。
4. 它告訴你加入了什麼。

要用更多語言顯示標題，請提出要求。Agent 會用 `asc app-clips invocations localizations create` 逐一加入。Apple 的說明指出，連結在所有語言中都保持不變。

測試連結只屬於一個建置版本。上傳下一個建置版本時，也請為它要求測試連結。Apple 的[測試 App Clip 體驗](https://developer.apple.com/help/app-store-connect/test-a-beta-version/test-an-app-clip-experience)允許每個建置版本最多三個。

## 在 iPhone 上開啟

1. 在 iPhone 上打開 Apple 的 TestFlight App，並在其中打開你的 App。
2. 按標題開啟 App Clip 的某個測試連結。Apple 表示，測試人員就是這樣開啟 Beta 版 App Clip 的：它不會被安裝，也不會出現在主畫面上。
3. App Clip 會以該連結開啟。Apple 表示，對於在 TestFlight 中設定的連結，App Clip 卡片不會出現。
4. 在聊天中告訴 Agent 你看到了什麼。如果有問題，它會修正 App Clip，Agent 們會上傳新的建置版本；請再次為新建置版本要求測試連結。

## 查看、更改或移除測試連結

請提出要求，例如：

```text
Which App Clip test links does build 12 have?
```

Agent 會用 `asc app-clips invocations list` 列出它們。要讓某個測試連結指向另一個連結，請說明是哪一個；Agent 會使用 `asc app-clips invocations update`。要更改標題，它會使用 `asc app-clips invocations localizations update`。要移除某個測試連結，請提出要求：`asc app-clips invocations delete` 需要 `--confirm`，所以 Agent 會先詢問你。移除的測試連結無法復原；Agent 可以重新加入。

## 常見問題

**App Clip 無法從 TestFlight 開啟。**

你的網站和 App Clip 可能還沒有相互關聯。請讓 Agent 檢查雙方；它可以用 `asc app-clips domain-status` 讀取 App Store Connect 中該建置版本的網域狀態。請參閱 Apple 的[檢視網域 URL 狀態](https://developer.apple.com/help/app-store-connect/offer-app-clip-experiences/view-domain-url-status)。

**我沒有看到 App Clip 卡片。**

這是正常的。Apple 表示，對於在 TestFlight 中設定的 App Clip 體驗，卡片不會出現。版本上線後你就會看到它。

**Agent 說 No invocations found。**

該建置版本還沒有測試連結。請讓 Agent 為它加入。

**這些就是 App Clip 標籤頁中的 App 審查連結嗎？**

不是。**App Clip** 標籤頁中 **App 審查**（「供 Apple 測試的連結」）下的連結是給 App 審查用的（請參閱[推出 App Clip](https://air.build/tw/docs/app-store/ship-an-app-clip/#help-app-review-open-it)）。測試連結是給你和你的 TestFlight 測試人員用的，每次針對一個建置版本。

**不用 TestFlight 能試用嗎？**

在預覽中，Agent 可以用任意連結開啟 App Clip：請參閱[測試能開啟你的 App 的連結](https://air.build/tw/docs/build/test-a-link-that-opens-your-app/#test-an-app-clip-link)。關於推出後使用你自己的連結及其專屬卡片，請參閱[透過你自己的連結或地點開啟 App Clip](https://air.build/tw/docs/app-store/open-your-app-clip-from-your-own-link/)。
